"unless" support in Spark

25 views
Skip to first unread message

Rob G

unread,
Jun 1, 2012, 12:28:18 PM6/1/12
to spar...@googlegroups.com
Due to somewhat popular request, as of version 1.7.2, I've added support for the new "unless" conditional.

If you've used it in Ruby then it'll seem natural, but if not, then simply consider it as an equivalent of "if not". This can be used as both an attribute on any node or as the node itself:

<div>
  <var arg="5"/>
  <unless condition="arg==5">
    <p>argis5</p>
  </unless>
  <unless condition="arg==6">
    <p>argisnot6</p>
  </unless>
</div>

<!-- outputs <div><p>argisnot6</p></div> -->

<div>
  <var arg="5"/>
  <p unless="arg==5">argis5</p>
  <p unless="arg==6">argisnot6</p>
</div>

<!-- outputs <div><p>argisnot6</p></div> -->

This feature is supported for all of Spark's current language compilers (Ruby, Python, C#, JavaScript and VB.NET)

All the best,
Rob

Louis DeJardin

unread,
Jun 1, 2012, 1:48:22 PM6/1/12
to Rob G, spar...@googlegroups.com
Beautiful!

--
Louis - sent from mobile

From: Rob G
Sent: 6/1/2012 9:28 AM
To: spar...@googlegroups.com
Subject: "unless" support in Spark

--
You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.
To post to this group, send email to spar...@googlegroups.com.
To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spark-dev?hl=en.
Reply all
Reply to author
Forward
0 new messages