Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

loop action with scheme
hi im new to scheme and was wondering if it is possible to create a
looping action with scheme. say the prompt is entered something like
this
(make-list 7 '())
this asks the to create a list with 7 of () so something like this
(() () () () () () ())
how would you go about making a scheme function to create this action


Report this thread to moderator Post Follow-up to this message
Old Post
isaac2004
04-08-06 12:04 AM


Re: loop action with scheme
"isaac2004" <isaac_2004@yahoo.com> wrote/schrieb <1144452780.481277.87260@i4
0g2000cwc.googlegroups.com>:

> how would you go about making a scheme function to create this action

(define (make-list n el)
(let loop ((n n) (a '()))
(if (< 0 n)
(loop (- n 1) (cons el a))
a)))

Report this thread to moderator Post Follow-up to this message
Old Post
Thomas Hafner
04-08-06 12:04 AM


Re: loop action with scheme
isaac2004 wrote:
> hi im new to scheme and was wondering if it is possible to create a
> looping action with scheme. say the prompt is entered something like
> this
> (make-list 7 '())
> this asks the to create a list with 7 of () so something like this
> (() () () () () () ())
> how would you go about making a scheme function to create this action

See

<http://schemecookbook.org/view/Cook...opingConstructs>

--
Jens Axel Søgaard

Report this thread to moderator Post Follow-up to this message
Old Post
Jens Axel Søgaard
04-08-06 12:04 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Scheme archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:11 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.