rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re: what if?, suggestion to re-instate the alternative if not syntax...
@ 1999-12-09  8:13 Byron Rakitzis
  0 siblings, 0 replies; 6+ messages in thread
From: Byron Rakitzis @ 1999-12-09  8:13 UTC (permalink / raw)
  To: bengt, rc

>I ahve a very rare wish to run Plan9 rc scripts using Byrons rc.

Without looking at the source, you'd have to change two things: the
yacc file (and the lexer), and any "undumping" code to emit function
definitions for export. The change should be trivial in both cases.

The question I have is why you'd want to do this!? Are there any useful
"standalone" rc scripts which are portable between plan9 and unix?


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

* Re: what if?, suggestion to re-instate the alternative if not syntax...
@ 1999-12-10  9:06 Bengt Kleberg
  0 siblings, 0 replies; 6+ messages in thread
From: Bengt Kleberg @ 1999-12-10  9:06 UTC (permalink / raw)
  To: bengt, byron, rc

> Are there any useful "standalone" rc scripts which are portable between plan9 and unix?

Given the plan9 source, and a large set of patches (boddles), it woud be nice to update the
source and burn a new CD-ROM. For various reasons I would prefer to burn the CD from Unix,
and also load the source, do the patch on Unix. The boddles are rc scripts, which use if not.

Note: I would not want to remove } else { . If not would only be a complement.

Best Wishes, Bengt
===============================================================
Everything aforementioned should be regarded as totally private
opinions, and nothing else. bengt@softwell.se
``His great strength is that he is uncompromising. It would make
him physically ill to think of programming in C++.''


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

* Re: what if?, suggestion to re-instate the alternative if not syntax...
@ 1999-12-10  9:00 Bengt Kleberg
  0 siblings, 0 replies; 6+ messages in thread
From: Bengt Kleberg @ 1999-12-10  9:00 UTC (permalink / raw)
  To: fosterd, rc

> > if not, ie the weird way of writing } else { that was  around in rc in the very beginning

> I'm curious, what is this syntax?

1 man page bug alert. the paper describing rc for plan9 is mentioned as included in the unix rc
distro. it is not. (or I can not find it)

2 the paper can be found at http://plan9.bell-labs.com/plan9/doc/rc.html

3 the old syntax was

if (test -f afile) {
echo file exists
}
if not {
echo file does not exist
}



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

* Re: what if?, suggestion to re-instate the alternative if not syntax...
  1999-12-09  8:00 ` Decklin Foster
@ 1999-12-09  8:22   ` Markus Friedl
  0 siblings, 0 replies; 6+ messages in thread
From: Markus Friedl @ 1999-12-09  8:22 UTC (permalink / raw)
  To: Decklin Foster; +Cc: rc

On Thu, Dec 09, 1999 at 03:00:21AM -0500, Decklin Foster wrote:
> Bengt Kleberg writes:
> 
> > Would it be possible to re-instate if not, ie the weird way of
> > writing } else { that was  around in rc in the very beginning? (and
> > still is in Plan9 rc).
> 
> I'm curious, what is this syntax?

the 'if not' syntax.
please read http://www.star.le.ac.uk/~tjg/rc/misc/td.html

for(i){
	if(test -f /tmp/$i) echo $i already in /tmp
	if not cp $i /tmp
}


> Anyway, my real question is, how
> important is being exactly like the original rc as a design
> consideration of this shell? I was recently thinking that i would have
> used 'foreach foo (bar)' (like Perl) instead of 'for (foo in bar)'.

why? this is a shell with a C-like syntax not a perl like
syntax. if you want perl go and use perl.

> But you couldn't go and change it now what with all these scripts
> already in place. Then there's my other message about mucking with ~.
> I can probably find more to complain about :-)

nope, rc is perfect.


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

* Re: what if?, suggestion to re-instate the alternative if not syntax...
  1999-12-08 15:13 Bengt Kleberg
@ 1999-12-09  8:00 ` Decklin Foster
  1999-12-09  8:22   ` Markus Friedl
  0 siblings, 1 reply; 6+ messages in thread
From: Decklin Foster @ 1999-12-09  8:00 UTC (permalink / raw)
  To: rc

Bengt Kleberg writes:

> Would it be possible to re-instate if not, ie the weird way of
> writing } else { that was  around in rc in the very beginning? (and
> still is in Plan9 rc).

I'm curious, what is this syntax? Anyway, my real question is, how
important is being exactly like the original rc as a design
consideration of this shell? I was recently thinking that i would have
used 'foreach foo (bar)' (like Perl) instead of 'for (foo in bar)'.
But you couldn't go and change it now what with all these scripts
already in place. Then there's my other message about mucking with ~.
I can probably find more to complain about :-)

-- 
Decklin
Written with Debian GNU/Linux - http://www.debian.org/


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

* what if?, suggestion to re-instate the alternative if not syntax...
@ 1999-12-08 15:13 Bengt Kleberg
  1999-12-09  8:00 ` Decklin Foster
  0 siblings, 1 reply; 6+ messages in thread
From: Bengt Kleberg @ 1999-12-08 15:13 UTC (permalink / raw)
  To: rc

Would it be possible to re-instate if not, ie the weird way of writing } else {
that was  around in rc in the very beginning? (and still is in Plan9 rc).

I ahve a very rare wish to run Plan9 rc scripts using Byrons rc. this is seldom,
but if it is possible/not difficult or so, I would like suggest it.

any comments?


Best Wishes, Bengt
===============================================================
Everything aforementioned should be regarded as totally private
opinions, and nothing else. bengt@softwell.se
``His great strength is that he is uncompromising. It would make
him physically ill to think of programming in C++.''


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

end of thread, other threads:[~1999-12-10 10:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-09  8:13 what if?, suggestion to re-instate the alternative if not syntax Byron Rakitzis
  -- strict thread matches above, loose matches on Subject: below --
1999-12-10  9:06 Bengt Kleberg
1999-12-10  9:00 Bengt Kleberg
1999-12-08 15:13 Bengt Kleberg
1999-12-09  8:00 ` Decklin Foster
1999-12-09  8:22   ` Markus Friedl

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