2008/7/12 Isaac Dupree <[email protected]>

> Isaac Dupree wrote:
> >  > $m/inst/stow/
> >
> > I just want to cd there!  It's no different from, say, ~/inst/stow/
> > which means the same thing as $HOME/inst/stow/ !  Tab completion even
> > works!  And I get:
> > fish: Variables may not be used as commands. Instead, define a function.
> > See the
> > help section for the function command by typing “help function”.
> >
> > I'm just going to patch fish to allow variables in commands (assuming
> > it's simple enough), for my own use; I'll send the patch in case you
> > feel like applying it.
>
> argh, parser.c seems so imperative with functionality mixed up in
> parsing, I'm not sure I'll be able to (hack around trying out things and
> making it do exactly what I want).  I'm of half a mind to rewrite the
> whole thing in Haskell, which could be fun, but take quite a while (and
> I haven't looked at the rest of fish's code, maybe the other parts would
> look better to me).. so who knows.  It would be ultimate to write fish
> in POSIX shell: a bit slow, but quite portable :-P (well, it would be
> quite sufficient just to have a way to automatically translate fish code
> to sh code -- remember eval is still a bit evil!)
>

Going over old mail, and found this. Amusing. :)

WRT the code in parser.c, you're 100 % correct. It's grown somewhat
haphazardly over a period of ~5 years. It's conceptually a mess, though a
reasonably well commented and structured mess. A through re-factoring of the
parser would definitely be nice.

As to the original question, I see your point, but allowing variables in
command names would be impossible to do for many builtins, e.g. those that
open a block, and I strongly dislike the concept of elevating some/all
buitins in fish to some magical 'keyword' status where they work differently
from the rest of all commands. The emphasis on making everything into a
command and making all commands obey the same rules whenever possible is
something I feel needs to be protected as far as possible.

To be perfectly honest, I sometimes play with the thought of making a new
fish syntax, one with closures, macros and other things that no sane person
would ever put in a command line shell. Would be kind of cool...


Axel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to