> $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.


Do note however that for programming -- not for convenient use -- there 
is a fairly easy solution that packages up the eval/function hackery 
(eval is at a great cost -- fish builtins/functions may be accidentally 
called, so you may actually not want to do this in a script) :

alias foo $dollars/using/expression
foo

If we wanted we could define

function run
   alias -l foo $argv[1]
   shift #wrong
   foo $argv
end

... except that there's no -l for alias so we're stuck with inlining its 
definitions... oh wait... there isn't even a -l for functions, and no 
lambda functions, they all have a global name!

And except that I couldn't find a way in fish's documentation to take a 
section of an array or in any way do something equivalent to bash's 
`shift` to get $argv[2..infinity]

I think it's plausible that:
$-in-command = warning in scripts = run = eval-ish
run = eval-ish (not at all equivalent to eval though, remember) = 
function or builtin or command or cd, in approximately that order.  And 
that's the problem, too, with using eval to implement it: the "command" 
could contain an evil string like 'begin;'.  However, I think we might 
be able to implement it as a function, using `type -t`.  Remember shells 
are not a macro expansion language!
command = you know = env
cd = you know
builtin = you know
function = er, is this possible? Probably to use "run" instead. Then 
(modulo one warning perhaps) we could define
function run; $argv; end

Maybe this will even be able to allow `run function --help` ;-)

-Isaac

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to