[Zope] Syntax

Benoit DOMINIAK benoit.dominiak@makinacorpus.com
Thu, 12 Jul 2001 15:10:50 +0200


Hi,
Yes, there is a difference :
<dtml-with "_[REQUEST.form['var']]"> put us in the object which has the id : 
REQUEST.form['var']   ==>  the value of var ;-)
It works whereas <dtml-with "REQUEST.form['var']"> doesn't.
Is it right ?

>From: Michael Gutmann <gutmann@uni-duesseldorf.de>
>Reply-To: gutmann@uni-duesseldorf.de
>To: Paul Zwarts <paz@www2.oratrix.NL>
>CC: benoit.dominiak@makinacorpus.com, Zope <zope@zope.org>
>Subject: Re: [Zope] Syntax
>Date: Thu, 12 Jul 2001 14:59:02 +0200
>
>Hello there,
>
>Paul Zwarts wrote:
>
>>Hi Benoit,
>>
>>AFAIK, the _ is used as a hack.
>>
>>_ actually is the namespace variable, but in this case:
>>
>>   REQUEST['var']   and    _[REQUEST['var']]
>
> > is no different. You use the _['something'] construction when a dash is 
>used
> > in the name:
>
>well, I am by no means a great zopemaster, but in my understanding this is
>_NOT_ the same. _ gives you access to the global namespace, that means to
>every variable that is defined at the moment you call it. Lets say, you 
>have a form,
>where var is filled with 'foo', then (after submitting, certainly ;-)
>REQUEST['var'] gives 'foo'. _['var'] gives the same result, when there
>is no other variable named 'var' in your global namespace (f.e. a property
>somewhere, but here I may miss).
>BUT: _[REQUEST['var']] is the same as _['foo'] and would look
>for a variable named 'foo'.
>
>>Did I miss anything, oh great zopemasters?
>
>Yes, son! :-))
>
>>Cheers,
>>Paz
>
>happy zoping,
>Michael
>
>--
>Michael Gutmann M.A.
>gutmann@uni-duesseldorf.de
>Multimediazentrum Heinrich-Heine-Universitaet Duesseldorf
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists -
>http://lists.zope.org/mailman/listinfo/zope-announce
>http://lists.zope.org/mailman/listinfo/zope-dev )

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.