[racket] Style. for/fold for/list for/lists

From: Roman Klochkov (kalimehtar at mail.ru)
Date: Sat Jan 18 12:57:12 EST 2014

  (define-values (total define-parsed define-outs set-outs out-refs fun-args fun-types init-args)
    (let loop ([args desc-args] [sum 0] [define-parsed null] [define-outs null] [set-outs null] [out-refs null] 
                                [fun-args null] [fun-types null] [init-args null])
      (cond 
        [(null? args) (values sum 
                              (reverse define-parsed) 
                              (reverse define-outs) 
                              (reverse set-outs) 
                              (reverse out-refs) 
                              (reverse fun-args)
                              (reverse fun-types)
                              (reverse init-args))]
        [else
             ...... ;; here set new values
             (loop (cdr args) new-sum new-define-parsed new-define-outs new-set-outs new-out-refs 
               new-fun-args new-fun-types new-init-args) 

I have to write values list triple! Or am I not doing it right? 


Суббота, 18 января 2014, 8:32 -05:00 от "J. Ian Johnson" <ianj at ccs.neu.edu>:
>I advocate it too, when I don't have to iterate through arbitrary do-sequences.
>-Ian
>----- Original Message -----
>From: "Neil Van Dyke" < neil at neilvandyke.org >
>To: "Roman Klochkov" < kalimehtar at mail.ru >
>Cc:  users at racket-lang.org
>Sent: Saturday, January 18, 2014 8:19:12 AM GMT -05:00 US/Canada Eastern
>Subject: Re: [racket] Style. for/fold for/list for/lists
>
>Roman Klochkov wrote at 01/18/2014 06:25 AM:
>> Where can I find style guide for these
>>
>> for/lists:
>
>Wouldn't it be easier to do with named-"let"?
>
>I advocate named-"let" sometimes on this email list.  Here's the first 
>one I found in Google:
>http://lists.racket-lang.org/users/archive/2012-April/051686.html
>
>Neil V.
>
>____________________
>  Racket Users list:
>   http://lists.racket-lang.org/users


-- 
Roman Klochkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140118/a8804734/attachment.html>

Posted on the users mailing list.