Article View: comp.lang.scheme.c
Article #246Re: Multiple args to for-each...
From: Dave Saunders
Date: Wed, 20 Dec 1989 18:45
Date: Wed, 20 Dec 1989 18:45
31 lines
1569 bytes
1569 bytes
You don't need macros. The way to handle variable numbers of parameters
is with (lambda L ...) in place of (lambda (x y) ...).
For example, for may you could do (untested):
(define map (lambda L (map-iter (car L) (cdr L))))
(define map1 map); rename the one list mapper
(define (map-iter f lists)
(if (null? (car lists))
()
(cons (apply f (map1 car lists)) (map-iter f (map1 cdr lists))) ))
I don't understand why you include apply in this context.
(apply foo arg-list) is the pattern, even in TI Scheme, I'm pretty sure.
D. Saunders
UDel
-----------------
I have Texas Instrument's PC Scheme V3.03 and I am disappointed that for-eac
h,
apply, and map constructs can only take one list (as an argument) from which
elements are drawn from. That is, they don't accept multiple list arguments
as standard Scheme should. Can anyone send me a macro version of for-each,
apply, and map that would take multiple args?
Yes, I have given it a shot myself but with finals I'm really pressed for
time.
T. Gottschalk
CMU
Technical Details
Message-ID:
<8912201346.aa10185@dewey.udel.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!UDEL.EDU!saundersReferences:
<IZXjTm_00WB78SKV1Z@andrew.cmu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!UDEL.EDU!saunders From: saunders@UDEL.EDU (Dave Saunders) Newsgroups: comp.lang.scheme.c Subject: Re: Multiple args to for-each... Message-ID: <8912201346.aa10185@dewey.udel.edu> Date: 20 Dec 89 18:45:58 GMT References: <IZXjTm_00WB78SKV1Z@andrew.cmu.edu> Sender: daemon@athena.mit.edu (Mr Background) Distribution: inet Organization: The Internet Lines: 31