Consider: <dtml-in select_zsqlmethod_sql> <dtml-var foo> </dtml-in> <dtml-in select_zsqlmethod_sql> <dtml-var bar> </dtml-in> 2 process calls to select_zsqlmethod_sql() <dtml-let sequence=select_zsqlmethod_sql> <dtml-in sequence> <dtml-var foo> </dtml-in> <dtml-in sequence> <dtml-var bar> </dtml-in> </dtml-let> 1 process call, isn't it?? Is it different for calls to other sequence returning things? like objectValues() or getResultScript() or whatever. I just want to use garbage collection instead of to many calls to other objects around. Peter
Peter Bengtsson wrote:
Consider:
<dtml-in select_zsqlmethod_sql> <dtml-var foo> </dtml-in> <dtml-in select_zsqlmethod_sql> <dtml-var bar> </dtml-in>
2 process calls to select_zsqlmethod_sql()
Yes.
<dtml-let sequence=select_zsqlmethod_sql> <dtml-in sequence> <dtml-var foo> </dtml-in> <dtml-in sequence> <dtml-var bar> </dtml-in> </dtml-let>
1 process call, isn't it??
Yes..
Is it different for calls to other sequence returning things? like objectValues() or getResultScript() or whatever.
No...
I just want to use garbage collection instead of to many calls to other objects around.
I'm not sure what garbage collection you're referring to, but making calls to things that return sequences and storing their results in a local variable (via dmtl-let) puts the sequence in memory for the duration of the let. -- Chris McDonough Zope Corporation http://www.zope.org http://www.zope.com "Killing hundreds of birds with thousands of stones"
I just want to use garbage collection instead of to many calls to other objects around.
I'm not sure what garbage collection you're referring to, but making calls to things that return sequences and storing their results in a local variable (via dmtl-let) puts the sequence in memory for the duration of the let.
That's great! "garbage collection", I meant like you say "in memory" <dtml-let makes a copy then Cheers
<dtml-let makes a copy then
slip of the tongue :) I meant <pseudo>copy</pseudo> In other words, loops and stuff inside the <dtml-let can continue to work even though you delete the objects it got its data from.
I think dtml-let stores a reference which is very different to making a
copy.
cheers,
Chris
_______________________________________________ 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 )
Peter Bengtsson wrote:
<dtml-let makes a copy then
slip of the tongue :) I meant <pseudo>copy</pseudo>
I think you need to find out the difference between a reference and a value ;-)
In other words, loops and stuff inside the <dtml-let can continue to work even though you delete the objects it got its data from.
What do you mean by 'delete the objects'? Chris
slip of the tongue :) I meant <pseudo>copy</pseudo>
I think you need to find out the difference between a reference and a value ;-)
So, you're saying that it's NOT a <pseudo>copy</pseudo> of the value of the computation?
In other words, loops and stuff inside the <dtml-let can continue to work even though you delete the objects it got its data from.
What do you mean by 'delete the objects'?
Suppose you assign with <dtml-let a sequence from a objectIds() method. At a splitsecond after the <dtml-let has been assigned you remove all objects that the objectIds() depend on in some other process (i.e. next time, there will be no result left). Will the <dtml-let have "saved a copy" or will it break? Peter
Peter Bengtsson wrote:
So, you're saying that it's NOT a <pseudo>copy</pseudo> of the value of the computation?
It's got nothing do do with a copy, a reference is a reference which is just a pointer to the same object as before...
Suppose you assign with <dtml-let a sequence from a objectIds() method. At a splitsecond after the <dtml-let has been assigned you remove all objects that the objectIds() depend on in some other process (i.e. next time, there will be no result left). Will the <dtml-let have "saved a copy" or will it break?
should do... Chris
participants (3)
-
Chris McDonough -
Chris Withers -
Peter Bengtsson