> On Mar 2, 2017, at 9:17 AM, David Storrs <david.sto...@gmail.com> wrote:
> I could, it's just extremely more verbose and therefore obfuscates what's
> actually going on as compared to the 'map' form.
Why not turn it into a macro that preserves your preferred notation:
(struct foo (a b c) #:transparent)
(define lst-A '(a b))
(define lst-B '(d e))
(require (for-syntax syntax/parse))
(define-syntax (map-index stx)
[(_ proc xs ... current-index ys ...)
(with-syntax ([(x-it ...) (generate-temporaries #'(xs ...))]
[(y-it ...) (generate-temporaries #'(ys ...))])
#'(for/list ([x-it (in-list xs)] ... [y-it (in-list ys)] ...
(proc x-it ... index y-it ...)))]))
current-index) ; ; (list (foo 'a 'd 0) (foo 'b 'e 1))
lst-B) ; (list (foo 0 'a 'd) (foo 1 'b 'e))
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
For more options, visit https://groups.google.com/d/optout.