Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: If I was forced to use only one kind of loop for the rest of my days it would be a

by Anonymous Monk
on Sep 30, 2005 at 15:28 UTC ( [id://496447]=note: print w/replies, xml ) Need Help??


in reply to Re^3: If I was forced to use only one kind of loop for the rest of my days it would be a
in thread If I was forced to use only one kind of loop for the rest of my days it would be a

(define a (list 1 2 3)) (set-cdr! a a) (for-each (lambda (x) (display "hello world\n")) a)
  • Comment on Re^4: If I was forced to use only one kind of loop for the rest of my days it would be a
  • Download Code

Replies are listed 'Best First'.
Re^5: If I was forced to use only one kind of loop for the rest of my days it would be a
by ambrus (Abbot) on Sep 30, 2005 at 15:59 UTC

    Please read what I said in the parent node.

    That's not a proper list, so r5rs doesn't guarantee this will work. It does work with some scheme implementations, but MzScheme says

    for-each: expects type <proper list> as 2nd argument, given: #0=(1 . # +0#); other arguments were: #<procedure:STDIN::59>
    if I type this code in it.

    Update: let me quote from the r5rs.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://496447]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2025-05-17 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.