[Spark View Engine] #42: More loop autovariables

0 views
Skip to first unread message

Spark View Engine

unread,
Aug 24, 2008, 12:36:30 PM8/24/08
to spar...@googlegroups.com
#42: More loop autovariables
---------------------------+------------------------------------------------
Reporter: louis.dejardin | Owner:
Type: enhancement | Status: new
Priority: major | Component: Spark Core
Keywords: |
---------------------------+------------------------------------------------
Artem Tikhomirov:

It'll be nice to introduce declare another autvariable is$
{eachVarName}Last. It would be useful in divider scenario:
{{{
<div each="var user in Users">
<User user="user " />
<br if="!isUserLast"/>
</div>
}}}

see also http://groups.google.com/group/spark-
dev/browse_thread/thread/596844232e2e9475

--
Ticket URL: <http://dev.dejardin.org/trac/spark/ticket/42>
Spark View Engine <http://dev.dejardin.org/trac/spark>
Spark View Engine

Spark View Engine

unread,
Aug 31, 2008, 3:28:48 PM8/31/08
to spar...@googlegroups.com
#42: More loop autovariables
-----------------------------+----------------------------------------------
Reporter: louis.dejardin | Owner:
Type: enhancement | Status: closed
Priority: major | Component: Spark Core
Resolution: fixed | Keywords:
-----------------------------+----------------------------------------------
Changes (by louis.dejardin):

* status: new => closed
* resolution: => fixed

Comment:

foreach(var varname in collection) code now has auto variables for
varnameIndex varnameCount varnameIsFirst and varnameIsLast.

It will also do a simple string search on the code inside the foreach
scope to see if each of the four autovariables is used, and only the ones
that are used will be generated. That's because varnameCount and
varnameIsLast are potentially slightly more expensive, especially if the
collection is the results of inline method calls.

So if you don't reference count or islast there's no impact at all.

--
Ticket URL: <http://dev.dejardin.org/trac/spark/ticket/42#comment:1>
Reply all
Reply to author
Forward
0 new messages