andrewchambers / janetsh

A powerful new shell that uses the janet programming language for both the implementation and repl.
https://janet-shell.org
MIT License
372 stars 13 forks source link

Commands that are janet functions don't necessarily need argument string conversion #190

Open andrewchambers opened 5 years ago

andrewchambers commented 5 years ago

It may be desirable to explicitly allow and write tests for things like:

($ (fn [table] (pp table)) @{"foo" "bar"})
@{"foo" "bar"}

Because a function is not an external command, but it still run after fork(), it could take arguments as other data types.

The counter argument is that it is consistent and simpler to just treat all commands as functions taking a list of strings. We need to flatten args anyway to deal with globbing.