[racket] Neophyte Alert

From: Jukka Tuominen (jukka.tuominen at finndesign.fi)
Date: Wed Aug 31 16:43:22 EDT 2011

>
> A few minutes ago, Neil Van Dyke wrote:
> > Josh Tilles wrote at 08/31/2011 01:03 PM:
> > > -- Is there any sort of general practice or prevailing taste in when
> > > to use (for example) *null* vs *empty* vs *(list)*? What about *(let
> > > ([...]))* vs *(local (define ...))*?
> >
> > I think most people do "'()" when they want a literal null list.
> > Don't use "(list)", since that's a procedure call.
>
> Two quick notes: (list) would be optimized the same, I think; and at
> least in the Racket sources I think that `null' is the more popular
> choice.  (With `empty' winning in the more HtDP-oriented side.)
>

#lang racket a.k.a. default language seems to be clear on this one when
evaluated

(list) >>  '()  didn't know this one myself
empty  >>  '()
null   >>  '()
'()    >>  '()

Then what is the 'correct' predicate to go with?

empty?
null?

anything else?


br, jukka








Posted on the users mailing list.