Fork me on GitHub
#announcements
<
2019-06-22
>
john16:06:26

perc is a fun little library for exploring alternative anonymous function syntaxes. Adds grabbing values by key name, in addition to the existing anonymous syntax, like #%/%(Point. %:x %:y %:z) Those and more features explained here https://github.com/johnmn3/perc

👍 3
aw_yeah 1
theeternalpulse03:06:37

if I were to do #%/%(some-fn %2:x %1y ... x) would the x be bound, or will I have to repeat the %2:x

john04:06:14

x would not be bound. You'd have to repeat %2:x, like you would with %2

john04:06:21

The symbols don't result in bindings. They pull the values out. %:akey is pretty much translated directly into (:akey %)

john04:06:03

Though % takes on a more unique name under the covers.

theeternalpulse04:06:11

so %:x %:y assume the function is passed a map {:x 1 :y 2}

theeternalpulse04:06:28

I wasn't clear on if it was just positional or doing some desructuring

john12:06:54

Right. A number represents an index into arguments passed in. The key does a lookup in whatever argument is selected.