[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elk] bigloo-2.9a, stklos-0.82 and elk-3.99.7 wrong behaviour + unknown failure in macro



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi lists,

in reaction to some behaviour claimed on #scheme to be correct which I thought
weird I had to put it to the test in my schemes. The following file does this:

(display "built-in cond is ")
(let ((else #f))
  (cond (#f 1)
        (else (display "not "))))
(display "weird")(newline)

(letrec-syntax ((my-cond
  (syntax-rules (else =>)
    ((my-cond (else result1 result2 ...))
     (begin result1 result2 ...))
    ((my-cond (test => result))
     (let ((temp test))
       (if temp (result temp))))
    ((my-cond (test => result) clause1 clause2 ...)
     (let ((temp test))
       (if temp
           (result temp)
           (my-cond clause1 clause2 ...))))
    ((my-cond (test)) test)
    ((my-cond (test) clause1 clause2 ...)
     (let ((temp test))
       (if temp
           temp
           (my-cond clause1 clause2 ...))))
    ((my-cond (test result1 result2 ...))
     (if test (begin result1 result2 ...)))
    ((my-cond (test result1 result2 ...)
           clause1 clause2 ...)
     (if test
         (begin result1 result2 ...)
         (my-cond clause1 clause2 ...))))))
  (display "user-defined cond is ")
  (let ((else #f))
    (my-cond (#f 1)
             (else (display "not "))))
  (display "weird")(newline))

All schemes which succeeded in running this were indeed double weird, which
apparently is correct, but bigloo-2.9a and stklos-0.82 failed to run the
second test because of unknown causes and they and elk-3.99.7 got the result
of the first test wrong. Here is the complete output of my testrun:

<begin of output>

gambit compiler:
compiling...
running...
built-in cond is weird
user-defined cond is weird

mzscheme:
built-in cond is weird
user-defined cond is weird

bigloo:
built-in cond is not weird
*** ERROR:map:
argument not a list -- #f
    0.... newline, weirdelse.scm:char 113

gauche:
built-in cond is weird
user-defined cond is weird

chicken compiler:
compiling...
running...
built-in cond is weird
user-defined cond is weird

guile:
built-in cond is weird
user-defined cond is weird

stklos:
built-in cond is not weird
**** Error while executing file "weirdelse.scm"
         Where: in %execute
        Reason: variable `=>' unbound

  - <<let/call>>
  - <<let/call>>
  - <<let/call>>
  - <<let/call>>
  - <<let/call>>
  - %execute
  - #[closure 6765b0]
  - call-with-values
  - #[closure 658a80]
  - try-load
  - ...
Set shell variable STKLOS_FRAMES to set visible frames
EXIT

elk:
built-in cond is not weird
top-level: unbound variable: letrec-syntax

<end of output>

regards,

Marijn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGRKMep/VmCx0OL2wRAjr5AJ4/e8voDfnP08EEcQyvDoKnZNkGUACeOT4p
QBAmVrHmcpY+Qd7rvXuS4xA=
=IxE+
-----END PGP SIGNATURE-----
-- 
This is the elk mailing-list, see http://sam.zoy.org/elk/
Trouble unsubscribing? Please contact <sam@zoy.org>
List archives are at http://sam.zoy.org/elk/threads.html