zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>,
	<zsh-workers@sunsite.dk>
Subject: Re: named references
Date: Thu, 28 Jun 2001 08:30:34 +0000	[thread overview]
Message-ID: <1010628083034.ZM6998@candle.brasslantern.com> (raw)
In-Reply-To: <000501c0ffa9$68c68350$21c9ca95@mow.siemens.ru>

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   


  reply	other threads:[~2001-06-28  8:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-24 11:34 Oliver Kiddle
2001-06-24 18:28 ` Bart Schaefer
2001-06-27 19:01   ` Oliver Kiddle
2001-06-28  8:07     ` Andrej Borsenkow
2001-06-28  8:30       ` Bart Schaefer [this message]
2001-06-28  9:39     ` Peter Stephenson
2001-06-30  7:56       ` Bart Schaefer
2001-07-02  9:31         ` Peter Stephenson
2001-06-30  7:37     ` Bart Schaefer
2001-07-09 19:43       ` Oliver Kiddle
2001-06-25  5:19 ` Andrej Borsenkow
2001-06-27 16:03   ` Oliver Kiddle
2001-06-27 16:50     ` Peter Stephenson
2001-06-27 19:18       ` Oliver Kiddle
2001-06-30  8:09         ` Bart Schaefer
2001-06-27 17:14     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1010628083034.ZM6998@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=Andrej.Borsenkow@mow.siemens.ru \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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