Discussion:
Learning EPIC5; alias differences
Jeremy Chadwick
2008-02-20 07:47:52 UTC
Permalink
I've been tinkering around with EPIC5 for a few days, and there's one
difference which has been the source of some confusion for me. Take
for example the following alias on EPIC4/ircII:

alias t //topic

This has two capabilities: a user can type "/t" and see what the current
topic is and when it was set, or they can type "/t hello bob" and set
the current topic.

This alias breaks on EPIC5, with "/t" by itself setting the topic to
literally nothing. The only solution I found was to do this, which
seems a bit unnecessary:

alias t { if ([$0]) { //topic $* } { //topic } }

Is there a more intelligent way of accomplishing what used to "just
work" in EPIC4?
--
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |
Jonas Trollvik
2008-02-20 09:04:26 UTC
Permalink
If you do it like this:
/alias t (args) {//topic $args;}
it will not change the behaviour.

Also you should not check ifs like if ( [$0]) since if you would try
to do /t 0 the if would evaluate that to false. Instead do if ( @ ) or
if ( # )
(@ expands to strlen and # expands to word count)

Best Regards
Jonas / kreca
Post by Jeremy Chadwick
I've been tinkering around with EPIC5 for a few days, and there's one
difference which has been the source of some confusion for me. Take
alias t //topic
This has two capabilities: a user can type "/t" and see what the current
topic is and when it was set, or they can type "/t hello bob" and set
the current topic.
This alias breaks on EPIC5, with "/t" by itself setting the topic to
literally nothing. The only solution I found was to do this, which
alias t { if ([$0]) { //topic $* } { //topic } }
Is there a more intelligent way of accomplishing what used to "just
work" in EPIC4?
--
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |
_______________________________________________
List mailing list
http://epicsol.org/mailman/listinfo/list
Jeremy Chadwick
2008-02-20 09:06:23 UTC
Permalink
Thanks much for this -- works like a charm! :-) I was just starting to
read the Wiki page on arguments, then I got your mail...
--
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |
Post by Jonas Trollvik
/alias t (args) {//topic $args;}
it will not change the behaviour.
Also you should not check ifs like if ( [$0]) since if you would try
if ( # )
Best Regards
Jonas / kreca
Post by Jeremy Chadwick
I've been tinkering around with EPIC5 for a few days, and there's one
difference which has been the source of some confusion for me. Take
alias t //topic
This has two capabilities: a user can type "/t" and see what the current
topic is and when it was set, or they can type "/t hello bob" and set
the current topic.
This alias breaks on EPIC5, with "/t" by itself setting the topic to
literally nothing. The only solution I found was to do this, which
alias t { if ([$0]) { //topic $* } { //topic } }
Is there a more intelligent way of accomplishing what used to "just
work" in EPIC4?
--
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |
_______________________________________________
List mailing list
http://epicsol.org/mailman/listinfo/list
Loading...