This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem with telnet server


jason songhurst wrote:
kawa does the same thing with one line:
(define (f n) (f))

neither of these examples should run in any scheme, because they make calls that have the wrong number of arguments. however in some other interpreted schemes (SCM, Bigloo, MzScheme) they croak when evaluated, not when defined.
This now gives you a clean compile-time error:
<stdin>:1:16: call to 'f' has too few arguments (0; must be 1)

  oddly, it doesn't happen with mutually recursive functions:
     (define (f n) n)
     (define (g) (f))

  these eval just fine and when g is applied, a runtime exception
  is thrown and you find yourself back at the REPL.
If you wrap the definition in a begin (to force them to be
processed as a unit), then yet yet a compile-time error.
You also do that when you place them in a file and compile it.
--
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]