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

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Mar 12 16:20:48 EDT 2015

On Mar 5, 2015, at 5:16 PM, Rufus <rlaggren at mail.com> wrote:

> Alex
> 
>> [racket processes variable definitions first, then functions]
> 
> Got it.


That's not true. When you evaluate a definitions area, 
you evaluate a module body and that process proceeds 
top to bottom for Racket definitions and expressions. 

In *SL, check-* tests are lifted to the very end of 
the module so that students can specify test properly. 

Keep in mind that 'value' means number, string, lambda, 
etc. And also keep in mind that 

 (define (f x) ... x ...) 

is short for 

 (define f (lambda (x) ... x ...))

The evaluator stops when it encounters an error. The 
interactions are will not know the defined (or imported) 
names then. 

Can Racket programs redefine variables then? Yes. Some. 
That's a careful balancing act. 










> 
> 
>> Ok, does it show that (or a similar message about not being able to re-define add1)
>> for your original program with BSL?  
>> ...
> 
> If I run the add1 definition, regardless I place it above or below the
> definition of atom?, Racket flags it w/a "...defined previously" error;
> when it does this it ignores the pair? problem in the atom? defintion.
> If I remove the unneeded add1 def, it then gives a "pair?... not
> defined" error for the atom? definition.
> 
> So Racket does variable defs first, then functions and checks for
> "previously defined" before trying to create any new functions. I guess
> this means that we cannot override existing function definitions in
> Racket? OK by me. <g>
> 
> I think in Javascript and maybe others one could just redefine right
> over the top of "inherited" stuff. But then that's probably
> apples/oranges and I began Racket b4 really learning much JS. JS seems
> to do pretty much whatever it wants, although D. Crockford has provided
> a lot of "good-practice" forms that look to make it civilized. JS is
> what actually got me looking at code again: It appears I need it to mess
> w/some really annoying bank websites that require 6, up to 20 or so,
> clicks to download images of your paper transactions. Each transaction,
> that is. But I need to learn modern concepts that weren't common
> practice when I left IT in the mid '80s. Crockford recommended TLS most
> highly and after going cross-eyed pencilling intermediate answers I
> decided I might as well just code the stuff. The rest is history...
> 
> I have to say, Racket looks _lovely_ compared to most of the development
> options I've found in the last few weeks. And while I don't think I'd
> actually try to _kiss_ the authors, I gotta say the documentation is
> fantastic. Better than anything I've seen anywhere.
> '
> Rufus
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users



Posted on the users mailing list.