rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* An interesting (maybe) point
@ 1992-12-14  1:58 John Mackin
  0 siblings, 0 replies; only message in thread
From: John Mackin @ 1992-12-14  1:58 UTC (permalink / raw)
  To: The rc Mailing List

After the discussions of some months back regarding "what is a function",
and "what is a return value", I pricked up my ears (as it were) when I
saw the following arrive on the ZMailer mailing list.  For those who
aren't familiar with it, ZMailer is a mail delivery system.  Part of
it is a shell, called "zsh", which is not to be confused with the
PD interactive shell of the same name.  ZMailer's zsh is intended to
be Bourne-with-extensions, and is used for writing ZMailer's configuration
scripts.  It has lists, and its lists nest, unlike rc.  That (IMHO)
makes it much harder to program in -- rc's flat lists are a much more
natural model for a shell.  Anyway, here is a cautionary tale that
demonstrates what happens when you don't keep the overall guiding principle
of what you are doing carefully in mind.

OK,
John.

--- begin message from ZMailer list
From: Felix Lee <flee@guardian.cs.psu.edu>
Date: Tue, 8 Dec 1992 03:13:30 +1100
To: zmailer@cs.toronto.edu
Subject: zmailer, zsh makes numbers disappear.
Message-Id: <92Dec7.110320est.87558@guardian.cs.psu.edu>

If you send mail to "123456", zmailer bounces it back correctly, but
the error says "no such user -" instead of "no such user 123456".

The number disappears because crossbar calls (uucproute "123456"), and
uucproute does a (return "$address"), where address=123456.

The problem is 'return' behaves entirely differently when it's given a
number.  This is a strange problem with zsh.  It looks like this will
also cause other subtle router problems that rarely occur in normal
operation, but will get exposed by the right combination of errors.

Workaround: replace all occurrences of (return $string) with
(echo $string; return), which a little less efficient, but does the
correct thing.
- --
--- end message from ZMailer list


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1992-12-14  2:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-12-14  1:58 An interesting (maybe) point John Mackin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).