rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re:  export of variables and functions
@ 1991-09-27 14:24 Donn Cave
  0 siblings, 0 replies; 4+ messages in thread
From: Donn Cave @ 1991-09-27 14:24 UTC (permalink / raw)
  To: rc

>  fn local { unexported=( $unexported $* ) }

I'd use it.

	Donn Cave, University Computing Services, University of Washington
	donn@cac.washington.edu


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

* Re: export of variables and functions
  1991-09-27 10:02 malte
@ 1991-09-27 16:04 ` Chris Siebenmann
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Siebenmann @ 1991-09-27 16:04 UTC (permalink / raw)
  To: rc

 I actually think that exporting everything is the right decision,
and certainly should be the default. All of my 'local' variables
tend to be function-local, as opposed to shell-local, and we already
have a mechanism for that. How many shell-local variables do people
have/would have?

	- cks


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

* Re:  export of variables and functions
@ 1991-09-27 13:29 Rich Salz
  0 siblings, 0 replies; 4+ messages in thread
From: Rich Salz @ 1991-09-27 13:29 UTC (permalink / raw)
  To: malte, rc

Byron and I have exchanged messages about this.  He rightly says that
the default must be to export something, rather than not export it
otherwise old scripts will break.

My idea of unexporting is to have a variable that names the variables to
not be exported.  This seems better then having two new commands, export
and unexport, and makes the "is this variable exported?" test very easy to
write.

fn local { unexported=( $unexported $* ) }
	/r$


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

* export of variables and functions
@ 1991-09-27 10:02 malte
  1991-09-27 16:04 ` Chris Siebenmann
  0 siblings, 1 reply; 4+ messages in thread
From: malte @ 1991-09-27 10:02 UTC (permalink / raw)
  To: rc

As I read the new man page (1.2) I see that there is still no way not
to export a variable (or function). How about this (which in fact is
borrowed from Wirths Oberon-2): 

	A variable (function) gets exported if its name is immediately
	followed by an '*' or some other char,
	else it is not.

_______________________________________________________________________________
malte@techfak.uni-bielefeld.de

send mail reply to:	Universitaet Bielefeld, Technische Fakultaet
		z. Hd. Malte Uhl
		Postfach 8640
		4800 Bielefeld 1



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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-09-27 14:24 export of variables and functions Donn Cave
  -- strict thread matches above, loose matches on Subject: below --
1991-09-27 13:29 Rich Salz
1991-09-27 10:02 malte
1991-09-27 16:04 ` Chris Siebenmann

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