chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Help with and-let* please.


From: Kon Lovett
Subject: Re: [Chicken-users] Help with and-let* please.
Date: Sat, 3 Feb 2007 15:42:38 -0800

On Feb 3, 2007, at 2:33 PM, Robin Lee Powell wrote:

I'm trying to work from http://srfi.schemers.org/srfi-2/srfi-2.html
because the Chicken site is down, and I can't make and-let* work for
me at all.  I've shown two attempts below.

In the chicken source, in csi.scm, there's:

(and-let* ([(fx>= a len)]
           [o (fxmod len 16)]
           [(not (fx= o 0))] )
    {stuff}     

which looks like it's trying to do something like my first example
below.  As you can see, though, mine doesn't actually work in any
useful sense.

The goal, in case it's subtle, is to have and-let* return #f after
the display of "foo.\n".

-Robin

- -----------

(define land
  (and-let*
    (
     (begin (display "foo.\n") #t)
     ((= 2 1))
     (begin (display "bar.\n") #t)
     )
    (begin
      (display "Still here.\n"))))
(display "land: ")
(write land)
(display "\n")

- ---

$ /tmp/land
foo.
Error: call of non-procedure: #<unspecified>

- -----------

- -----------

(define land
  (and-let*
    (
     (begin (display "foo.\n") #t)
     (= 2 1)
     (begin (display "bar.\n") #t)
     )
    (begin
      (display "Still here.\n"))))
(display "land: ")
(write land)
(display "\n")

- ---

address@hidden> /tmp/land
foo.
bar.
Still here.
Error: call of non-procedure: #<unspecified>

- -----------

  (and-let*
    ([(begin (display "foo.\n") #t)]
     [(= 2 1)]
     [(begin (display "bar.\n") #t)] )
    (begin
      (display "Still here.\n")))

You forgot the enclosing braces for each sub-form. ('[...]' is not necessary, '(...)' is fine.)


--
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/
Reason #237 To Learn Lojban: "Homonyms: Their Grate!"
Proud Supporter of the Singularity Institute - http://singinst.org/


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]