On 9/22/06, Beni Cherniavsky <[EMAIL PROTECTED]> wrote: [...] > Why do we have builtins at all? > (1) Things like ``set`` are builtin because a subprocess can't modify > the shell's state. > (2) Things like ``while ... end`` are builtins to have special syntax > recognized by the parser. > Functions are essentially builtin scripts, existing for reason (1). > > But (1) is not a reason, as fishd proves: if the shell becomes a > server, things like ``set`` and ``cd`` can be implemented as external > commands! > This is perhaps an immediately good idea. > > As for (2), it is possible to turn control structures into external > commands, but it requires going a long way toward TCL. Consider > `xargs`: it's essentially a for loop (at least in -1 mode). And > `watch` is a ``while true`` loop with some output wrapping. The trick > is to supply the body as an argument, quite like in TCL. It means you > need to quote multiple, perhaps nested commands in some way. More > importantly, it means parsing of command boudaries can't depend on the > command being used (because it's external). Both lead almost > inevitably to TCL-style quoting with symentric delimiters, e.g. > ``while COMMAND [CMD; CMD]`` instead of ``while COMMAND; CMD; CMD; > end``. > I have a growing feeling that TCL got this aspect right but it's > obviously a very major change.
This sounds like quite an excting idea, though I don't understand the part about quoting. Which part of ``while COMMAND [CMD; CMD]`` is quoted -- are [ and ] quoting characters? Can you still have syntax highlighting? ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
