On 4/22/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> On 4/22/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
>
> >
> > Would it be terrible if the error message also printed the value of
> > variable PWD?
>
> They do! The body of the suggested fundtion is the value of PWD.

Oh, I didn't notice!

On second thought, the user probably just wants to access the value of
the variable "PWD", not define a function.  So the error message like
this would be more helpful:

fish> $PWD
fish: Variable 'PWD' has value '/home/mojo/'.  Variables may not be
used as commands! Instead, you can type 'echo $PWD', or define a
function like
'function PWD; echo /home/mojo/; end'. To read about the 'function'
command, type 'help function'.


> > [...]
> > > > > fish> function say!hello; echo hello; end
> > > > > fish: Invalid character '!' in function name.  Only alphabetic and
> > > > > numeric characters and underscore are valid.
> > > > >
> > >
> > > Since posix does not prevent filenames from containing a '!', I think
> > > this error is misleading. There could have been a command called
> > > 'say!hello' and it would run just fine.
> >
> > But Fish prevents functions from containing a '!', which is just what
> > the messages says.  You can't define a function called 'say!hello'.
>
> True, but doesn't the message imply that because functions dialow it,
> that this is an illegal command name, when the truth is that a regular
> command may contain a '!'.

I don't think it implies it.  It says it is an illegal function name,
not an illegal command name.  Perhaps it would be clearer, we could
say "You cannot define a function with that name. ...".

But it is true that we wanted to make builtins, functions and
executable files used in the same way.  And this naming convention
breaks exposes the difference.

> The real problem is simply
> that a command with the specified name doesn't exist. The fact thatthe
> given command name is also not a legal function name is not the main
> problem.

It doesn't matter that it does not exist.  The user is trying to
_define_ a new function with a weird name.  That's the problem.


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to