This is the mail archive of the kawa@sourceware.org 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: void? throws an exception


On 01/04/2011 07:26 PM, alex mitchell wrote:
I just updated to the latest version in svn after quite some time (previous
version that I was running was 6632), and found that where I had previously
been using the procedure void? in my code, now I'm getting an exception (see
below).

I checked in a fix for this. Your expression should now work.


However, note that I don't promise to support this.  void is not a value
- it is *zero* values.  I've considered having having multiple values
in an argument expand to multiple arguments:
    (fun a (values b c) d) === (fun a b c d) ;; possible future
The experimental Q2 languages does this:
http://per.bothner.com/blog/2010/Q2-extensible-syntax/
I'm not doing this for Kawa-Scheme partly because I'm not sure of the
best semantics and partly because of performance concerns.

I agree the "API" for multiple values in general and void in particular
needs to be clarified/fixed.  This ties in with sequences and list
comprehensions, which I'm working on.

(define (void? anything)
  (equal? #!void anything))

This may turn into a compile-time error ... In general, depending on the value of an expression that is guaranteed to return void (i.e. #!void) is likely to be an error, so I think it may be more helpful to prohibit such expressions rather than allow the.

but its strange that this previously worked and now doesn't. I'm guessing
this is a problem with the automatic generation of the type-testing
predicate.

I'm surprised. I don't think I declared void? before. It's certainly not there in the Kawa 1.9.1 shipped with Fedora 14.

(Sigh - any volunteer to take over Kawa packing for Fedora - or Debian or Ubuntu?)
--
--Per Bothner
per@bothner.com http://per.bothner.com/



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