Re: Dokgen failing.
- From: "Martin Elwin" <martin@elwin.com>
- To: "Ola Bini" <ola.bini@gmail.com>
- Cc: dev@ioke.kenai.com
- Subject: Re: Dokgen failing.
- Date: Fri, 9 Jan 2009 12:00:05 +0100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=JHI+s1RAYbPQmnrs3pTr4F3+T23ahmsMT8Lr+T+D9z6paN4+UfdDlpNWBYbVuHnB1B BbqoxTI7CzVnjofKgNRSvLYYOR6lKTHGkI1dO01VjSh6ku08AXqvxkWW/u0D8xpmnbhZ 0uGcKMUxT8o8iCA11IKpAuB7l9fkPQeD23hGY=
On Fri, Jan 9, 2009 at 11:45 AM, Ola Bini <ola.bini@gmail.com> wrote:
>> DefaultBehavior FlowControl in = macro("executes the arguments with
>> the receiver as context and ground, and then returns the result of the
>> last argument.
>>
>> call arguments map(evaluateOn(cell("@"))) last)
>>
>> which could give:
>>
>> cell(:val) in (
>> kind?("DefaultMethod") ||
>> kind?("LexicalBlock") ||
>> kind?("DefaultMacro") ||
>> kind?("LexicalMacro") ||
>> kind?("DefaultSyntax")
>> )
>
> Well, I would recommend doing this (which already works):
>
> case(cell(:val) kind,
> or("DefaultMethod", "LexicalBlock",
> "DefaultMacro", "LexicalMacro", "DefaultSyntax"),
> ;; do something here)
>
> of course, what you want can almost be done with "do", except that "do"
> doesn't return the last value.
Right, for this specific case - I understand. But I was really looking
for a do which returns the last result instead of the receiver (like
the in macro above, which I based on do), which is quite convenient
when accessing multiple cells on "deep" objects:
if(a b c in(kind?("Foo") || cell?("bar"), ....
However, if it doesn't exist, it's easy to define the macro yourself -
wherever needed - one of the charms of a language like this...!
Thanks,
/M
| Martin Elwin | 01/08/2009 | |
| Ola Bini | 01/09/2009 | |
| Martin Elwin | 01/09/2009 | |
| Ola Bini | 01/09/2009 | |
|
Re: Dokgen failing. |
Martin Elwin | 01/09/2009 |





