[racket] TLS "atom?" definition for Scheme does not work in DrRacket

From: Alexander D. Knauth (alexander at knauth.org)
Date: Tue Mar 3 19:44:58 EST 2015

On Mar 3, 2015, at 6:34 PM, Rufus <rlaggren at mail.com> wrote:

> Matthias
> 
> My goodness. There seems to be some strangeness here.
> 
> 1) When using "#lang racket" and running the defs file,
>   - Atom? is defined regardless of whether the "AND clause
>      get parens ie. "Atom?" entered on the interactive pane
>      (then hit Enter) tells us it's a proc regardless the
>      way it's defined.
>   - (Atom? x) (where x is defined) throws an error if its
>      definition used parens around the AND clause but works
>      as expected w/out them.

When you checked that it “works as expected,” did you check that it returns false for non-empty lists?

> 2) When using BSL-lists:
>   - Atom? can be defined on the interactive pane using parens
>      around the AND clause the way it appears in TLS; it
>      works as expected.
>   - Atom? cannot be defined on the i-pane w/out the parens
>      around the AND clause because it throws a syntax error.
> 
> 3) As an aside: Under BSL-lists, I cannot get any code in the
>    defs file to run. At least none of the definitions exist
>    after I load the file and click "Run". So now it comes back
>    to me exactly what led me to use the "#lang racket" spec:
>    The code in the defs file was not getting executed when I
>    used the BSL-lists, loaded the defs file and clicked Run.
> 
> GOT IT! The toggle for the atom? weirdness is the (define and '...)
> included in the variable defs I made up from the TLS examples. Ie. a
> reserved word problem.

One of the things I really like about DrRacket is that it can draw arrows from an identifier to its definition.
In the file with the (define and ‘…), when you hover over the and in the atom? definition, 
does it show an arrow pointing to the (define and ‘…) ?

> Doesn't know the exact mechanism but nottt a
> problem. <g>
> 
> Still unclear on why BSL-lists apparently won't run a defs file. Another
> day…

BSL+list-abbrevs doesn’t let you re-define and; Is that the reason?




Posted on the users mailing list.