rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re: matching "nothing" seems to be broken
@ 1991-10-27 16:02 Byron Rakitzis
  0 siblings, 0 replies; 2+ messages in thread
From: Byron Rakitzis @ 1991-10-27 16:02 UTC (permalink / raw)
  To: rc

This is not really a bug, but it is misleading behavior
from rc.

The problem is that lists are not recursive in rc. Therefore
there is no way to put a null list inside another list. So
what happens when you type

foo=(a () b () c)

?

Well, rc strips out the "redundant" parentheses.

The same occurs for ~, since syntactically, what follows the
subject list is a list of patterns. (NOT a list of pattern
lists)

Therefore

	()

represents the empty list, but

	() ''

represents a list with an empty string in it that hasn't been
stripped down to

	''

by the parser yet.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* matching "nothing" seems to be broken
@ 1991-10-27  0:52 David J. Fiander
  0 siblings, 0 replies; 2+ messages in thread
From: David J. Fiander @ 1991-10-27  0:52 UTC (permalink / raw)
  To: rc


I'm having a slight problem.  I want to be able to check to see
if a variable is either not set, or set to the empty string, so
I write

	if (~ $foo () '') echo all clear

The problem is that the list of words to compare $foo to is not
being evaluated properly (or at least I don't think so).  The
() is being removed for some reason, so 'rc -x' reports the
test "~ $foo ''".

However, the test "~ $foo ()" works; it is only parsed wrong
when the list of words to compare against is longer than one.

Has anybody else seen this?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1991-10-27 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-10-27 16:02 matching "nothing" seems to be broken Byron Rakitzis
  -- strict thread matches above, loose matches on Subject: below --
1991-10-27  0:52 David J. Fiander

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