Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this message"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)))
Post Follow-up to this messageisaac2004 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
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.