This question is totally welcome here! I hope to make this a place where people can feel free to ask any question, no matter how basic it may seem. We’re all learning.
So, it seems to work on mine. You can see the prompts (
exploratorium.core>), the printouts, and then the return (
exploratorium.core> (choosey ["chocolate" "gum" "cookies" "pizza" "hard candy"])
Your first choice is: chocolate
Your second choice is: gum
Nobdy cares about the rest. But, for the record, here are the also-rans: cookies, pizza, hard candy
The reason it’s returning
nil is that functions return the value of their last expression. In this case, it’s a
println always returns nil.
It looks like your destructuring is working correctly. I’m not sure what light table is doing with the
println output, which typically goes to standard out. Can you check in Light Table’s repl?