[Zope-dev] Functional programming

Duncan Booth duncan@rcp.co.uk
Thu, 24 Feb 2000 09:36:51 +0000


lambda is available, but you have to specify an extra default 
argument _vars=_vars
> Is there a good reason why I can't use map, filter and lambda
> in DTML code? (They're not in the namespace.)
> 
Even without map and filter this can be useful on occasion if you 
find yourself otherwise repeating an expression a lot of times. On 
the other hand it isn't very pleasant to look at.

I think the answer is probably that if you find you need to use map 
and filter then you should consider using Python instead. Besides 
you can get the effect of both of these with dtml-in.


-- 
Duncan Booth                                             duncan@dales.rmplc.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
http://dales.rmplc.co.uk/Duncan