On Donnerstag, 9. September 2010, Ralph Lange wrote:
> On 08.09.2010 18:57 Benjamin Franksen wrote:
> > On Donnerstag, 9. September 2010, Andrew Johnson wrote:
> >> I'll be on vacation until next Wednesday now.
> >>
> >> I don't like the keyword "scope", can you find some other word
> >> instead? It has too much of a "computer-science theory"
> >> connotation. Even "block" would be better, but that's not very
> >> descriptive either.
> >
> > I'll try to come up with something that doesn't scare people off,
> > is reasonably short, and still conveys the meaning. Any suggestions
> > anyone?
>
> What about "group"?
> From all the stupid ideas that I had, this sounded most applicable
> and comprehensive even to non-geek people.
It's a possibility. Others I have thought of are "var" and --now my
favourite-- "let", as it has been used in many programming languages to
mean "local definitions follow". (It is also familiar from mathematical
texts as in "let x be defined as...", though I guess it's just geeks
like me who view this as a helpful mnemonic.)
> BTW: I assume that every call to msi will implicitly be a group.
Yes, in the sense that definitions given on the command line are visible
throughout the whole substitution file.
> Will
> - in addition to that - also each substitutions file have its own
> implicit group? (Making it work much like C file scope.)
I have not planned this, it seems this would re-introduce globals
through the back door. See below.
> The crucial issue is how concatenating subst files and running msi on
> the result will differ from running msi on the same set of subst
> files. (That was a Diamond use case, iirc.)
Yes, which is the reason I would rather not allow that. The problem is
that you can have defaults when referencing a macro, e.g. "$(X=abc)".
This means it makes a difference whether the variable is defined or
not. This is really something for which there is no equivalent in
languages like C. I think you can do it in Perl with something like
my x = defined(x) ? x : abc;
though I would have to try it out to be sure ;-)
One thing I would like to add instead is to treat every file block as if
it contained an implicit let-block, i.e. allow definitions to come
before any substitution instances (or the 'pattern' keyword). These
would scope over all the substitution instances. I think it would be
highly useful to be able to factor out common definitons for each
instance of a certain template without having to enclose the whole
thing in an extra let-block.
BTW, I am working on a formalization of the semantics and the abstract
syntax by using Haskell as a specification language. Doing so promptly
uncovered a few bugs in the spec. Yay!
Cheers
Ben
--
"Never confuse what is natural with what is habitual."
-- Mahatma Gandhi
- References:
- Re: msi again Benjamin Franksen
- Re: msi again Ralph Lange
- Navigate by Date:
- Prev:
Re: Dynamic Loading and Unloading of EPICS Device Support and Record. Ralph Lange
- Next:
Re: Dynamic Loading and Unloading of EPICS Device Support and Record. Ben Franksen
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: msi again Ralph Lange
- Next:
Re: msi again Goetz Pfeiffer
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|