All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald van Dijk <harald@gigawatt.nl>
To: dash@vger.kernel.org
Cc: "ольга крыжановская" <olga.kryzhanovska@gmail.com>,
	"Eric Blake" <eblake@redhat.com>
Subject: Re: static vs. dynamic scoping
Date: Sun, 14 Nov 2010 01:09:55 +0059	[thread overview]
Message-ID: <4CDF28EB.3080709@gigawatt.nl> (raw)
In-Reply-To: <AANLkTimm=WL8xw7UxyaBVVzFUKxboCndc-Kv64OaZeQX@mail.gmail.com>

On 14/11/10 00:54, ольга крыжановская wrote:
> Now function a uses typeset IFS="X" to set the field separator to "X"
> via a local variable IFS. If function b now uses "read foo1 foo2 foo3"
> to read a line of a database the concept of dynamic scoping *BITES*.

The way I had seen "local IFS" used is to sanitise IFS -- to reset IFS 
to the default value, when IFS was set to, for example, : before the 
function was called, and the function wants to split on whitespace. In 
that case, you don't want b to get IFS=:. Both forms are used, and in 
your form, I agree, static scoping is more useful.

  reply	other threads:[~2010-11-14  0:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09 22:02 static vs. dynamic scoping Eric Blake
2010-11-13 23:22 ` Harald van Dijk
2010-11-13 23:54   ` ольга крыжановская
2010-11-14  0:10     ` Harald van Dijk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-11-10 14:15 ольга крыжановская
2010-11-10 21:01 ` Jilles Tjoelker
     [not found] <4CD9C280.60007@redhat.com>
     [not found] ` <4CDA6301.1010703@gmail.com>
2010-11-10 15:13   ` Eric Blake
2010-11-15 21:11     ` Cedric Blancher
2010-11-15 21:45       ` Eric Blake

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=4CDF28EB.3080709@gigawatt.nl \
    --to=harald@gigawatt.nl \
    --cc=dash@vger.kernel.org \
    --cc=eblake@redhat.com \
    --cc=olga.kryzhanovska@gmail.com \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.