Arc Forumnew | comments | leaders | submitlogin
1 point by skenney26 5420 days ago | link | parent

Thanks for the feedback. I'll take a look at how rand-choice and pull can improve shuffle and choices.

I use between alot with numbers and would like a similar utility for strings, but I understand its confusing that the arguments to between work exclusively with strings but inclusively with numbers.

param is just mapping over a paired list. Infinite recursion shouldn't be a problem.



2 points by akkartik 5420 days ago | link

There's a call to param inside param's body. Isn't it the same fn? Ah, it's just the tag macro's private language.

between with a string == substring between delimiters. between without a string == pick a random number in a range. Is that right? It's not just about exclusive/inclusive, that's pretty different semantics.

-----

1 point by skenney26 5420 days ago | link

I meant that the return value of the string version doesn't include the delimiters (between "ab" "ef" "abcdef"), while when something like (between 3 7) is called, the return value could also be 3 or 7.

Maybe it would make more sense to modify rand so that it could return numbers in a range if given 2 arguments.

-----