thanks, the whole idea is to localize the identifiers to the for (preferred) or the let*.
Reaching back to get the whole list when the for has bound the same identifier is probably asking a bit much. Within the given strictures I probably need to bind the list in the let* and use a different identifier in the for(). On Friday, June 14, 2019 at 12:46:54 PM UTC-4, David Storrs wrote: > > > > On Fri, Jun 14, 2019 at 10:45 AM Sanjeev Sharma <[email protected] > <javascript:>> wrote: > >> within this for loop is there any way to access different pieces of the >> description and amt? car-ing and cdr-ing for example? >> > > I'm not entirely clear on what you're looking for, but maybe this helps? > > (define lst '(a b c)) > (for ([(val idx) (in-indexed lst)]) > (displayln (cons val idx)) > (when (< idx (sub1 (length lst))) > (displayln (format "\tnext val: ~a" (list-ref lst (add1 idx)))))) > > Output: > (a . 0) > next val: b > (b . 1) > next val: c > (c . 2) > > >> Or move the identifier definitions into the let*, and pass those to for >> in some way? >> >> (let*((ratio 9/12)) >> (for((description(list "this" "that")) >> (amt(list 4467.61 2428.37))) >> (printf"~a ~a: changed values\n" >> description >> (cat(* amt ratio) -2.)))) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Racket Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/racket-users/07ad5ce3-0ba8-48a5-a356-5cb1545de4cd%40googlegroups.com >> >> <https://groups.google.com/d/msgid/racket-users/07ad5ce3-0ba8-48a5-a356-5cb1545de4cd%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/cd979a18-c099-42b3-99f9-48ce099da19d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

