This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Constructs for programming with sequences


>>>>> "Mikael" == Mikael Djurfeldt <mdj@nada.kth.se> writes:

Mikael> Mikael Djurfeldt <mdj@nada.kth.se> writes:
>> 1. Generation
>> 
>> (map-index N PROC) --> LIST

Mikael> Another candidate for this one could be

Mikael>   (for-map FROM TO STEPPER PROC)

Mikael> Maybe that looks even prettier in the code

Mikael>   (for-map 1 10 1+ (lambda (i) i))

What about the implementation of CL (loop ...) construct?

      (loop for i from 1 to (compute-top-value)       ; first clause
            while (not (unacceptable i))              ; second clause
            collect (square i)                        ; third clause
            do (format t "Working on ~D now" i)       ; fourth clause
            when (evenp i)                            ; fifth clause
              do (format t "~D is a non-odd number" i)
            finally (format t "About to exit!"))      ; sixth clause

--
Best regards,
	Valentin.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]