jerome.martin.dev
2018-3-27 12:17:22

@jerome.martin.dev has joined the channel


jjwiseman
2018-3-27 16:52:47

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?



jjwiseman
2018-3-27 19:15:05

How do i match zero-or-one using match? I see a way to do zero-or-more…


jjwiseman
2018-3-27 19:17:57

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)?


slack1
2018-3-27 20:47:37

As an interface, what do people think about (map lambda arr) vs (map arr lambda)?


notjack
2018-3-28 06:21:04

@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)


notjack
2018-3-28 06:23:46

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


notjack
2018-3-28 06:25:50

@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))


notjack
2018-3-28 06:26:31

but sequence-map accepts only one sequence because a sequence can produce multiple values at once


jjwiseman
2018-3-28 06:49:07

@notjack, thanks, (or (list) (list v)) seems good