Re: [Zope] tino's <dtml-in> improvements Why, DC?
Chris Withers wrote:
You'll probably get some waffle back about poluting the namespace.
Though I haven't yet been convinced myself by the namespace-pollution argument, perhaps this is something that does need to be considered further before the 'prefix' part of tino's proposal could be adopted. However I soon no reason why Zope 2.3.1 couldn't right now incorporate that part of the proposal that provides underscored alternatives for the hypenated variables, so allowing <dtml-var expr="somefunc(sequence_item)"> instead of <dtml-var expr="somefunc(_['sequence-item'])"> Though I readily agree that Python Scripts are the proper place for logic, the example above shows that there is often still a need for some code in support of the presentation. Why not make it a bit easier? Hamish Lawson ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie
<dtml-var expr="somefunc(sequence_item)">
instead of
<dtml-var expr="somefunc(_['sequence-item'])">
Though I readily agree that Python Scripts are the proper place for logic, the example above shows that there is often still a need for some code in support of the presentation. Why not make it a bit easier?
Hamish Lawson
Good py-engineering is important, but what is also VERY IMPORTANT is to attract more Zpeople to use Zope! I have a few times (not many but a few) seen sad faces on people when they see this sequence-item "problem". What they don't quickly understand is how fantastic all of those sequence-things are! And, beginners DO NOT use python scripts when they are dubbed into Zope, they use Zope. Peter
Brian Lloyd wrote:
I've added the DTML namespace changes to the [2.4] plan
And the crowd cried "Huzzah!" :-)
For those wondering "why not 2.3.1?", 2.3.1 is a bug-fix release, and this will be a feature with a non-trivial documentation impact.
That seems fair enough.
There [are] concerns about namespace pollution and stomping on variables that people may have currently defined
It's proper to address this. But some aspects of tino's or others' proposals are probably less problematic than others, and the plan could perhaps attempt to have different levels of ambition, so that we increase the probability of getting *some* progress. Maybe tino might want to consider splitting the patch into two patches that separately address underscore aliasing and custom loop variables? Hamish Lawson ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie
There [are] concerns about namespace pollution and stomping on variables that people may have currently defined
It's proper to address this. But some aspects of tino's or others' proposals are probably less problematic than others, and the plan could perhaps attempt to have different levels of ambition, so that we increase the probability of getting *some* progress. Maybe tino might want to consider splitting the patch into two patches that separately address underscore aliasing and custom loop variables?
Hamish Lawson
Right - these are the kinds of decisions I'd like to see hammered out in the fishbowl project area. Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com
Hi all, Brian Lloyd wrote:
There [are] concerns about namespace pollution and stomping on variables that people may have currently defined
It's proper to address this. But some aspects of tino's or others' proposals are probably less problematic than others, and the plan could perhaps attempt to have different levels of ambition, so that we increase the probability of getting *some* progress. Maybe tino might want to consider splitting the patch into two patches that separately address underscore aliasing and custom loop variables?
Hamish Lawson
Right - these are the kinds of decisions I'd like to see hammered out in the fishbowl project area.
This seems logic at the first glance. But keep in mind the "pollution" of the namespace is more caused by the patch to remove the hypenations. The second part shows only up, if a programmer _decides_ to use it. E.g. if you dont use the prefix argument, it is still "sequence" and therefore perfectly compatible with code assuming this. If you, however decide to use the prefix, you should know what you do as always. Regards Tino
Tino Wildenhain wrote:
Hi all,
Brian Lloyd wrote:
There [are] concerns about namespace pollution and stomping on variables that people may have currently defined
It's proper to address this. But some aspects of tino's or others' proposals are probably less problematic than others, and the plan could perhaps attempt to have different levels of ambition, so that we increase the probability of getting *some* progress. Maybe tino might want to consider splitting the patch into two patches that separately address underscore aliasing and custom loop variables?
Hamish Lawson
Right - these are the kinds of decisions I'd like to see hammered out in the fishbowl project area.
This seems logic at the first glance. But keep in mind the "pollution" of the namespace is more caused by the patch to remove the hypenations.
Yup.
The second part shows only up, if a programmer _decides_ to use it. E.g. if you dont use the prefix argument, it is still "sequence" and therefore perfectly compatible with code assuming this. If you, however decide to use the prefix, you should know what you do as always.
But in this case, you are being explicit and it should be easy to pick a name that doesn't exist. The prefix part of the patch makes the aliasing part of the patch unnecessary, since you can always get nice names using the prefix attribute. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org
Hi Jim, ...
The second part shows only up, if a programmer _decides_ to use it. E.g. if you dont use the prefix argument, it is still "sequence" and therefore perfectly compatible with code assuming this. If you, however decide to use the prefix, you should know what you do as always.
But in this case, you are being explicit and it should be easy to pick a name that doesn't exist.
The prefix part of the patch makes the aliasing part of the patch unnecessary, since you can always get nice names using the prefix attribute.
You forget about these ugly hypenations :) Regards Tino
Tino Wildenhain wrote:
You forget about these ugly hypenations :)
And that's the one I think most people want solved ;-) (to be honest, I've never been in a situation to need the second(prefix?) part of the patch...) cheers, Chris
Tino Wildenhain wrote:
Hi Jim,
...
The second part shows only up, if a programmer _decides_ to use it. E.g. if you dont use the prefix argument, it is still "sequence" and therefore perfectly compatible with code assuming this. If you, however decide to use the prefix, you should know what you do as always.
But in this case, you are being explicit and it should be easy to pick a name that doesn't exist.
The prefix part of the patch makes the aliasing part of the patch unnecessary, since you can always get nice names using the prefix attribute.
You forget about these ugly hypenations :)
I think we are not communicating. I assume that the names introduced via prefixes are constructed with underscores, not hyphens, so the use of prefixed names solves the hyphenation problem. Right? Prefix-introduced names don't cause namespace pollution because they are under the control of the script author, who knows what names she is using. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org
Hi Jim, Jim Fulton wrote:
Tino Wildenhain wrote:
...
You forget about these ugly hypenations :)
I think we are not communicating. I assume that the names introduced via prefixes are constructed with underscores, not hyphens, so the use of prefixed names solves the hyphenation problem. Right?
Thats not the case. The Prefix is the prefix, both for hypenation and for underscore. It only substitutes the word "sequence".
Prefix-introduced names don't cause namespace pollution because they are under the control of the script author, who knows what names she is using.
Unfortunately not. The hypenation occours many times in a variable name depending on the attribute in question. Regards Tino
Tino Wildenhain wrote:
Hi Jim,
Jim Fulton wrote:
Tino Wildenhain wrote:
...
You forget about these ugly hypenations :)
I think we are not communicating. I assume that the names introduced via prefixes are constructed with underscores, not hyphens, so the use of prefixed names solves the hyphenation problem. Right?
Thats not the case. The Prefix is the prefix, both for hypenation and for underscore. It only substitutes the word "sequence".
Prefix-introduced names don't cause namespace pollution because they are under the control of the script author, who knows what names she is using.
Unfortunately not. The hypenation occours many times in a variable name depending on the attribute in question.
OK, then what we'll do is implement prefix so that it only generates names with underscores. That way, it wall address the hyphenation problem. We will discourage use of the in tag (and all other tags that generate variables) without a prefix attribute. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org
Jim Fulton wrote:
I think we are not communicating. I assume that the names introduced via prefixes are constructed with underscores, not hyphens, so the use of prefixed names solves the hyphenation problem. Right?
I was wondering if I was the only one who thought this. It seems to me that i you want sequence_index, just use a prefix of 'sequence'. Problem solved. --sam -- --------------------------------------------------------- A lot of things wrong with society today are directly attributable to the fact that the people who make the laws are sexually maladjusted. -- from "I Seem To Be a Verb" by R. Buckminster Fuller, 1970.
sam gendler wrote:
I was wondering if I was the only one who thought this. It seems to me that i you want sequence_index, just use a prefix of 'sequence'. Problem solved.
If that works, then I'm just being silly so ignore me. If it doesn't, then I'm not being silly, please don't ignore me ;-) cheers, Chris
Chris Withers wrote:
sam gendler wrote:
I was wondering if I was the only one who thought this. It seems to me that i you want sequence_index, just use a prefix of 'sequence'. Problem solved.
If that works, then I'm just being silly so ignore me.
If it doesn't, then I'm not being silly, please don't ignore me ;-)
I haven't used the patch. I just read the description of it when this thread first appeared. Perhaps I am the one being silly. Doesn't it allow anything to be specified as the prefix, as well as providing variables in the form of 'sequence_?' If it does, then you probably can't use a prefix of sequence, since you will get a name conflict, but it should be easy enough to remove the second half of the patch, so it only provides the prefix functionality, without the addition of the duplicate variable names. --sam -- ----------------------------------------------- "Whenever you find yourself on the side of the majority, it is time to pause and reflect." --Mark Twain
Chris Withers wrote:
sam gendler wrote:
I was wondering if I was the only one who thought this. It seems to me that i you want sequence_index, just use a prefix of 'sequence'. Problem solved.
If that works, then I'm just being silly so ignore me.
If it doesn't, then I'm not being silly, please don't ignore me ;-)
There's no reason why it shouldn't work and it doesn't have the backward compatability problems of implicit aliases. If it doesn't work, we'll make it work. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org
On 28/3/01 3:26 pm, "sam gendler" <sgendler@akamai.com> wrote:
Jim Fulton wrote:
I think we are not communicating. I assume that the names introduced via prefixes are constructed with underscores, not hyphens, so the use of prefixed names solves the hyphenation problem. Right?
I was wondering if I was the only one who thought this. It seems to me that i you want sequence_index, just use a prefix of 'sequence'. Problem solved.
--sam
Exactly what I though too - but the debate between the 'big brains' was making me think I was out to lunch! :) Just need to wait for 2.4 now (luverly). Tone -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
participants (8)
-
Brian Lloyd -
Chris Withers -
Hamish Lawson -
Jim Fulton -
Peter Bengtsson -
sam gendler -
Tino Wildenhain -
Tony McDonald