LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

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

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

Print Reply
Subject:
From:
Joseph Wright <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Wed, 13 Apr 2011 16:44:34 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (32 lines)
Hello all,

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.

There are arguments for and against the difference in behaviour.

On the side of the current approach, an empty sequence is very different
from a missing key in a a property list. If a sequence is being used as
a stack, then trying to get/pop once it is empty is probably going to be
due to a coding error. If you potentially return \q_no_value then there
has to be a quark test each time you get a value, and that does not make
so much sense for a stack.

On the other hand, \q_no_value is defined as being a special return
value used when there is 'nothing to return'. Doing

  \seq_pop_left:NN \<seq> \<tl var>
  \quark_if_no_value:NF \<tl var>

is not going to be too much slower than the current code, as there is an
internal test which would be removed if the behaviour was changed.

Thoughts?
-- 
Joseph Wright

ATOM RSS1 RSS2