Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: named references
- X-seq: zsh-workers 15154
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>, <zsh-workers@xxxxxxxxxx>
- Subject: Re: named references
- Date: Thu, 28 Jun 2001 08:30:34 +0000
- In-reply-to: <000501c0ffa9$68c68350$21c9ca95@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <000501c0ffa9$68c68350$21c9ca95@xxxxxxxxxxxxxx>
On Jun 28, 12:07pm, Andrej Borsenkow wrote:
} Subject: RE: named references
}
} This does not touch everything (I need some time to swallow the rest :-)
}
} What happens in this case:
}
} foo() {
} typeset -n r=v
} local v=foo
} echo $r
} }
}
} v=bar
} foo
}
} I.e. does r refer to outer v ("by address" could you say) or to inner
} v ("by name" would it be then)? The latter would be badly broken; but
} to implement the former you must have reference to pm not the name.
You actually don't need the reference, you just need both the name and the
local-level.
Oliver's partial implementation got this right, by stashing the target
local-level in the reference's `ct' field, and then after looking up the
parameter by name, searching its `old' linked list for the right `level'.
But using a pointer directly to the pm is a lot faster.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author