On 6/2/15 11:37 AM, Greg Wooledge wrote:
> Ksh's nameref is completely different. With one of ksh's two different
> kinds of functions, you actually CAN use ksh nameref to pass a value
> back to the caller without variable name collisions.
In my opinion, the most interesting thing about ksh93's
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 6/1/15 9:59 PM, Shawn Wilson wrote:
> Top posting as I'm kinda going out of band of the thread here;
>
> Having read the discussion, I guess the issue I brought up really
> isn't a "bug" (though Greg's points probably should be considered
> bugs).
On Tue, Jun 2, 2015 at 7:31 AM, Greg Wooledge wrote:
> There's declare -i, but no sane person USES that, so we can ignore it.
While in bash `-i` likely either has no effect or slows things down
very slightly, in ksh93 and probably zsh it's a huge performance win
because it prevents integers and f
On +2015/06/02 08:31:57, Greg Wooledge wrote:
>
> > Also, whatever happens, I think there should also be a way to test
> > for variable type (either another test flag or something like perl's
> > ref() ).
>
> Bash is not a strongly typed language. You've got strings, and indexed
> arrays, and a
On Tue, Jun 02, 2015 at 11:16:27AM -0400, Shawn Wilson wrote:
> I would argue that a nameref is a variable type.
I suppose you're right, insofar as it has its own special rules that
you have to know about.
A lot of people wanted declare -n to be more than it is. It's really
just syntactic sugar
On Mon, Jun 01, 2015 at 09:59:51PM -0400, Shawn Wilson wrote:
> I'll preface this by saying I'm not an expert in bash by any
> means. However, most languages have a garbage collection facility
C does not. Bash (all shells, really) is very strongly influenced by C.
> and most
> high level languag
Top posting as I'm kinda going out of band of the thread here;
Having read the discussion, I guess the issue I brought up really
isn't a "bug" (though Greg's points probably should be considered
bugs). I'll preface this by saying I'm not an expert in bash by any
means. However, most languages have
On 5/27/15 8:25 AM, Greg Wooledge wrote:
> 1) It doesn't cross scopes. It's not like Tcl's upvar at all. It
> only refers to a variable in the same scope (which, following the
> standard bash rules, means it'll recursively search upward until
> it finds a matching variable by name).
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 5/26/15 5:02 PM, Shawn Wilson wrote:
> On +2015/05/26 18:05:18, Geir Hauge wrote:
>> On Tue, May 26, 2015 at 11:00:45AM -0500, Eduardo A. Bustamante López wr
ote:
>>> # Here we 'unset ref', which actually unsets 'var'. Then, we assign 'va
r' to
>>>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 5/26/15 10:31 AM, Shawn Wilson wrote:
> swilson@swlap1:~/temp$ bash --version
> GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
> swilson@swlap1:~/temp$ cat t.txt
> $ome text !n a file|
> swilson@swlap1:~/temp$ unset t
> swilson@swlap1:~/
On Tue, May 26, 2015 at 05:02:43PM -0400, Shawn Wilson wrote:
> If there's no good reason to keep this as is (some use case where
> this might be wanted and breaking backward compatibility - I can't
> see anyone actually *wanting* it this way) shouldn't it be changed?
> A behavior can be documented
On +2015/05/26 18:05:18, Geir Hauge wrote:
> On Tue, May 26, 2015 at 11:00:45AM -0500, Eduardo A. Bustamante López wrote:
> > # Here we 'unset ref', which actually unsets 'var'. Then, we assign 'var' to
> > # 'ref', but since 'ref' is still a nameref, it instead assigns 'var' to
> > 'var'.
> > dua
On Tue, May 26, 2015 at 11:00:45AM -0500, Eduardo A. Bustamante López wrote:
> # Here we 'unset ref', which actually unsets 'var'. Then, we assign 'var' to
> # 'ref', but since 'ref' is still a nameref, it instead assigns 'var' to
> 'var'.
> dualbus@hp:~$ unset ref; ref=var; echo "$ref"; declare -
On Tue, May 26, 2015 at 05:47:30PM +0200, Geir Hauge wrote:
[...]
> The surprising part is that it keeps the -n flag, but partially loses
> the nameref ability:
>
> $ var=foo; declare -n ref
> $ ref=var
> $ printf '%s - ' "$ref"; declare -p ref
> foo - declare -n ref="var"
> $ unset ref
> $ ref=va
On Tue, May 26, 2015 at 11:24:57AM -0400, Shawn Wilson wrote:
> On +2015/05/26 11:04:38, Greg Wooledge wrote:
> > On Tue, May 26, 2015 at 10:31:34AM -0400, Shawn Wilson wrote:
> > > swilson@swlap1:~/temp$ bash --version
> > > GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
> > > swilson@s
On +2015/05/26 11:04:38, Greg Wooledge wrote:
> On Tue, May 26, 2015 at 10:31:34AM -0400, Shawn Wilson wrote:
> > swilson@swlap1:~/temp$ bash --version
> > GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
> > swilson@swlap1:~/temp$ cat t.txt
> > $ome text !n a file|
> > swilson@swlap1:~/t
On Tue, May 26, 2015 at 10:31:34AM -0400, Shawn Wilson wrote:
> swilson@swlap1:~/temp$ bash --version
> GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
> swilson@swlap1:~/temp$ cat t.txt
> $ome text !n a file|
> swilson@swlap1:~/temp$ unset t
> swilson@swlap1:~/temp$ t=$(< ./t.txt)
> swi
17 matches
Mail list logo