[ksh93, mksh] How to un-nameref an identifier?

2014-09-12 Thread Thorsten Glaser
Hi David,

I’m having a slight problem (shbot runs ksh93 when asked “k#”):

19:06⎜mirabilos:#ksh k# nameref x=y; y=z; echo $x,$y; unset x; echo $x,$y
19:06⎜«shbot:#ksh» mirabilos: z,z
19:06⎜«shbot:#ksh» mirabilos: ,
19:06⎜mirabilos:#ksh k# nameref x=y; y=z; echo $x,$y; nameref x=; echo $x,$y
19:06⎜«shbot:#ksh» mirabilos: z,z
19:06⎜«shbot:#ksh» mirabilos: ksh: typeset: : invalid variable name
19:06⎜mirabilos:#ksh ok, ksh93 behaves the same… how does one “un-nameref” an 
identifier?

This is mksh:

19:06⎜mirabilos:#ksh m# nameref x=y; y=z; echo $x,$y; nameref x=; echo $x,$y
19:06⎜«shbot:#ksh» mirabilos: z,z
19:06⎜«shbot:#ksh» mirabilos: mksh: x=: empty nameref target
19:07⎜mirabilos:#ksh pre-R50 mksh showed ',z' on the second line

For reference, the versions installed on shbot right now are:

19:17⎜mirabilos:#ksh k# echo ${.sh.version}
19:17⎜«shbot:#ksh» mirabilos: Version AJM 93u+ 2012-08-01
19:17⎜mirabilos:#ksh m# echo $KSH_VERSION
19:17⎜«shbot:#ksh» mirabilos: @(#)MIRBSD KSH R50 2014/07/28

Basically, I need something so that $x is no longer a nameref;
changing it to another target is of course possible, or leaving
a function in which it was a local variable, but what about the
main program in which I also want to occasionally use namerefs,
e.g. in sourced libraries?

I cannot let it refer to itself in either shell, either:

19:15⎜mirabilos:#ksh k# nameref x=y; y=z; echo $x,$y; nameref x=x; echo $x,$y
19:15⎜«shbot:#ksh» mirabilos: z,z
19:15⎜«shbot:#ksh» mirabilos: ksh: typeset: x: invalid self reference

mksh has: mksh: x: expression recurses on parameter


Right now, I believe using 'nameref x=' to un-nameref it
is the way to go, and would restore that for mksh, but since
it’s your feature, I thought I’d rather ask you first.

(You don’t sit in IRC on Freenode, do you?)

Thanks in advance,
//mirabilos
-- 
„Cool, /usr/share/doc/mksh/examples/uhr.gz ist ja ein Grund,
mksh auf jedem System zu installieren.“
-- XTaran auf der OpenRheinRuhr, ganz begeistert
(EN: “[…]uhr.gz is a reason to install mksh on every system.”)


Re: [ksh93, mksh] How to un-nameref an identifier?

2014-09-12 Thread Thorsten Glaser
Dixi quod…

Hi David,

Nevermind…

19:22⎜mirabilos:#ksh 550 5.1.1 d...@research.att.com: Recipient address 
rejected: User unknown in local
 ⎜recipient table
19:23⎜«jilles:#ksh» mirabilos, yes, dgk and gsf don't work there anymore

Right now, I believe using 'nameref x=' to un-nameref it

Nevermind this either…

19:25⎜«jilles:#ksh» un-nameref - try  unset -n  ?
19:25⎜mirabilos:#ksh ah, there's an unset -n?
19:25⎜mirabilos:#ksh k# nameref x=y; y=z; echo $x,$y; unset -n x; echo $x,$y
19:25⎜«shbot:#ksh» mirabilos: z,z
19:25⎜«shbot:#ksh» mirabilos: ,z

I’m obviously not using ksh93, normally, so I was unaware.

R50c coming up…

bye,
//mirabilos
-- 
(gnutls can also be used, but if you are compiling lynx for your own use,
there is no reason to consider using that package)
-- Thomas E. Dickey on the Lynx mailing list, about OpenSSL


Re: [ksh93, mksh] How to un-nameref an identifier?

2014-09-12 Thread Thorsten Glaser
Dixi quod…

Right now, I believe using 'nameref x=' to un-nameref it

Nevermind this either…

R50c coming up…

… or this.

20:21⎜mirabilos:#ksh m# nameref x=y; y=z; echo $x,$y; typeset +n x; echo $x,$y
20:21⎜«shbot:#ksh» mirabilos: z,z
20:21⎜«shbot:#ksh» mirabilos: y,z

Thanks to ormaaj for reminding me… so, no R50c coming up ☺

bye,
//mirabilos
-- 
 Hi, does anyone sell openbsd stickers by themselves and not packaged
 with other products?
No, the only way I've seen them sold is for $40 with a free OpenBSD CD.
-- Haroon Khalid and Steve Shockley in gmane.os.openbsd.misc