LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Will Robertson <[log in to unmask]>
Thu, 14 Apr 2011 18:14:17 +0930
text/plain (34 lines)
On 14/04/2011, at 1:14 AM, Joseph Wright wrote:

> Currently, if you do
> 
>  \prop_get:NnN \<prop-list> { <key> } \<tl var>
> 
> and the <key> is not in the \<prop-list> then the \<tl var> ends up as
> \q_no_value. On the other hand, for sequences trying to 'pop' or 'get'
> from an empty sequence leads to a (deliberate) error.


My personal thoughts:

* These should probably be consistent.
* I think returning a quark is dangerous in case of sloppy package authors.
* I favour a deliberate error message for all in such cases, with a variant function for the "error" case; e.g.,

    \seq_clear:N \l_tmp_seq
    \seq_pop:NN \l_tmp_seq \x

should yield "Error: The sequence \l_tmp_seq is empty." with the possibility of also writing

    \seq_clear:N \l_tmp_seq
    \seq_pop:NNF \l_tmp_seq \x { <recovery code> }

in which the recovery code is executed in this case.

* * *

The above is just my own view on things and not necessarily optimal. I'm open to discussion, of course.

Cheers,
-- Will

ATOM RSS1 RSS2