Her is a small pointless program

  #lang racket
  (define (neq args) (not (apply = args)))
  (provide neq)

So then loading this in racket:

racket@> (load "temp-lib.rkt")
racket@> (neq 1 0)
neq: undefined;
 cannot reference undefined identifier
  context...:
   /usr/share/racket/collects/racket/private/misc.rkt:87:7


Why is neq undefined after the load?  I could see symbols in a module with 
load before the upgrade ..

Now there is a (provide neq) in there so why not use require?  Lets try 
that in the same session:

racket@> (require "temp-lib.rkt")
racket@> (neq 1 0)
neq: arity mismatch;
 the expected number of arguments does not match the given number
  expected: 1
  given: 2
  arguments...:
   1
   0
  context...:
   /usr/share/racket/collects/racket/private/misc.rkt:87:7


Yes, now the symbol can be seen. Good, and oh yeah, a '.'is missing in the 
source so let me add that.  The edited and saved source code now appears as:

#lang racket
(define (neq . args) (not (apply = args)))
(provide neq)


So again, in the same session, lets use this new better source code:

racket@> (neq 1 0)
neq: arity mismatch;
 the expected number of arguments does not match the given number
  expected: 1
  given: 2
  arguments...:
   1
   0
  context...:
   /usr/share/racket/collects/racket/private/misc.rkt:87:7


Alas, racket does seem to see the updated code.  My guess is that the 
second require did nothing because racket already though it had that file. 
Is this the case?  Anyway, I did this twice in different variations, and 
indeed new edits do not come in.  Well then what to do, here I kill the 
racket process and run it again (kinda like rebooting windows after a 
problem):

racket@> 
It's been nice interacting with you!
Press C-c C-z to bring me back.
Welcome to Racket v6.1.
racket@> (require "temp-lib.rkt")
racket@> (neq 1 0)
#t
racket@> 
racket@> (require "temp-lib.rkt")
racket@> (neq 1 0)
#t
racket@> 


Yes, after rebooting racket I see my changes.

Ok, what is going on here?  What happened to load?  How do I load a file so 
that I can work on it while seeing all the bindings?  How do I reload a 
file after an edit?    



 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/76ffc46f-7231-4bf1-aa66-e873904ff181%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to