Found the bug.
Nu cons evaled the cddr as second argument,
it should be the caddr.
This did no harm in most other operations,
but with NuBlocks is is a difference whether you
have (do () ("x")) or ((do () ("x")) .
So (cons (do () ("x")) (do () ("y"))) yielded (<NuBlock: 0x7fbad2e62dc0> . "y")
But it should: (<NuBlock: 0x7fbad2e62dc0> . <NuBlock: 0x7fbad2e94200>) as jogo expected.
Maybe there was also a deeper sense in the code Tim wrote,
and I am wrong.
So I propose a fix is below, I hope this will work in all situations and not unintentionally break other things.
(I mean cons is one of the basic functions at all)
So maybe a lot of people can test this and tell, wether it works with their things.
So far it seems good for me.
@implementation Nu_cons_operator
- (id) callWithArguments:(id)cdr context:(NSMutableDictionary *)context
{
id cadr = [cdr car];
id caddr = [[cdr cdr] car];
id value1 = [cadr evalWithContext:context];
id value2 = [caddr evalWithContext:context];
id newCell = [[[NuCell alloc] init] autorelease];
[newCell setCar:value1];
[newCell setCdr:value2];
return newCell;
}
@end
(BTW, poting code with Google Groups is no fun)