andrewchambers / janet-sh

Shorthand shell like functions for janet.
84 stars 7 forks source link

nil should be ignored #11

Closed concatime closed 3 years ago

concatime commented 3 years ago

Hi, is it possible to ignore nil values? Currently, it thows error: unsupported argument nil. Thank you.

andrewchambers commented 3 years ago

It's not currently possible.

The current design is to help prevent accidents when you did not intend for a nil value to appear.

I tend to do something like:

(sh/$ echo ;(if foo [foo] []) )

instead.

concatime commented 3 years ago

Understandable. Yep, that’s what I was doing too.