Boost Docs :
Subject: Re: [Boost-docs] The beauty of LATEX
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-10-22 06:09:25
On 10/22/2011 5:08 PM, Daniel James wrote:
> On 22 October 2011 02:48, Joel de Guzman <joel_at_[hidden]> wrote:
>> On 10/21/2011 6:14 PM, Daniel James wrote:
>>> I think your third list is incorrect.
> is a single element list with 2 elements, but it says it's a 2 element list.
Jeepers! Describing such a simple thing in english makes me dizzy! :-)
> I think you'll need to add another built-in function for calling
> function arguments, such as:
> [def foo a][[`call [`a]]]
> Otherwise consider:
> [def foo a][[`a]]
> [def bar][x]
> [foo [bar]]
> Does invoking [`a] return a list of one item, or the text 'x'?
Let me re-code that using the latest syntax tweak
[def foo a][[a]]
Here, foo expects a nullary lambda. You pass [lambda][bar],
which, when evaluated in foo as [a], returns the text 'x'.
Did I get that right? I think it's quite consistent with
our current behavior where arguments become nullary templates
that need to be invoked. Here, lambdas are n-ary functions.
It just so happens that bar is also nullary.
I have a feeling that I misunderstood you again.
> Whenever you have a list parameter, you'll need to either bind it to
> the state at the location it was passed or do a function lookup at
> that point, so that this doesn't do the wrong thing:
> [def foo f bar][[`call [`f]]]
> [def bar]
> [`foo [bar] 2]
> I'm not sure that call 'foo' is correct, the right call might be:
> [`foo [[bar]]].
Ok, I think too much super-luminal neutrinos zipped through
me and I'm lost :P Are you invoking bar at function call
Could you please re-code that with the latest syntax?
It would also help if you provide meaningful cases like
dup, cat, etc. instead of foo and bar.
> Oh, I forgot to mention before, you need something to distinguish
> between lists and non-lists, for handling trees.
-- Joel de Guzman http://www.boostpro.com http://boost-spirit.com