From: Timothy J. H. <ti...@cs...> - 2004-11-04 23:10:32
|
On Nov 4, 2004, at 5:44 PM, Ken Anderson wrote: > Thanks for your description of #null. Its interesting that Scheme, > and functional languages can get along without it. Why is that? I > think Common Lisp had a #null called NIL. > > My plan was that #null and #f would be distinct objects, but that > #null would be treated as #f. in conditionals. That seems more reasonable as it just extends the semantics of some primitives and special forms but doesn't change the data model of the language. > > The problem with Rusty and Geof's macros is you need to provide ifj, > andj, orj, notj, and condj. Here's a piece of code that's written in > this style: > > (let ((effective (.getNotamEffectiveDtg n)) > (expire (.getNotamExpireDtg n))) > (if (andj effective expire) > (prefix " WEF " (string-append (.substring effective 2) > "-" > (.substring expire 2))) > (ifj expire (prefix " TIL " (.substring expire 2)) > (ifj effective (prefix " WEF " (.substring effective > 2))))))) > > which i don't like. I agree, combining if and ifj, or and orj, etc gets too messy and creates new sources of error. . The alternative of changing the standard definition of if, cond, or, and, etc to treate #null as #f seems reasonable to me. If someone didn't like it they could always use a module that redefines them to their original meanings... ---Tim--- > > treating #null like #f in conditions lets java collections return > #null but let you write code like (if (member x y) ... or (if (.get > table key) ... > > k > At 04:16 PM 11/4/2004 -0500, Alan Donovan wrote: >> I agree; I think it's much cleaner to keep #null distinct from #f. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |