@jerome.martin.dev has joined the channel
hello. are there examples of how to specify a deps
in info.rkt
that includes a git dependency for automatic installation via raco pkg install
?
nm, i found a schema at https://docs.racket-lang.org/pkg/Package_Concepts.html#%28tech._package._source%29
How do i match zero-or-one using match
? I see a way to do zero-or-more…
relatedly, is there a way to do matching/destructuring using lambda argument declaration style (what I think racket calls gen-formals, and in common lisp would be called a lambda list)?
As an interface, what do people think about (map lambda arr)
vs (map arr lambda)
?
@jjwiseman there’s probably a more succinct way, but you can use or
to explicitly specify the zero and one element cases: (match lst [(or (list) (list v)) ...])
(if you wanted and there’s no better way already, you could even stick that in a match expander)
as for lambda-list parsing, I don’t think there’s anything out of the box but it probably wouldn’t be too difficult to build as a match expander
@slack1 note that map
and vector-map
both take the function first because they can accept multiple lists / vectors, letting you do things like (map + (vector 1 2 3) (vector 10 20 30))
but sequence-map
accepts only one sequence because a sequence can produce multiple values at once
@notjack, thanks, (or (list) (list v))
seems good