MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Dynamic scoping


Block is supposed to be a dynamic scoping construct. Therefore, in the following, "Print" should be an undefined function. But consider:

Block[{Plus},
 t = ToString[Plus[1, 2]];
 Print[t];
 ]

The output of this is: "3" and not "Plus[1,2]" as it would be if "Print" has no defined meaning.
cheers, Daniel



  • Prev by Date: Re: strange behaviour of ListPlot with PlotStyle options in
  • Next by Date: Re: Apollonius' circle tactation
  • Previous by thread: Re: strange behaviour of ListPlot with PlotStyle options in
  • Next by thread: Re: Dynamic scoping