You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org> on 2007/04/27 13:03:15 UTC
[jira] Created: (VELOCITY-542) minus sign in #set requires spaces
to surround it
minus sign in #set requires spaces to surround it
-------------------------------------------------
Key: VELOCITY-542
URL: https://issues.apache.org/jira/browse/VELOCITY-542
Project: Velocity
Issue Type: Bug
Components: Engine
Affects Versions: 1.5
Reporter: Will Glass-Husain
Priority: Minor
The following example:
#set($thisCampNumber = 10)
#set($nextCampNumber = $thisCampNumber+1)
#set($previousCampNumber = $thisCampNumber-1)
#set($previousCampNumberB = $thisCampNumber - 1)
1: $thisCampNumber<br>
2: $nextCampNumber<br>
3: $previousCampNumber<br>
4: $previousCampNumberB<br>
produces this result
1: 10
2: 11
3: $previousCampNumber
4: 9
Note that using a minus sign in a #set statement does not work if there are no spaces around it. (however, the same is not true for +).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Commented: (VELOCITY-542) minus sign in #set requires spaces
to surround it
Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492313 ]
Nathan Bubna commented on VELOCITY-542:
---------------------------------------
This is because '-' is a valid character in a reference.
Try doing #set( $thisCampNumber-1 = "hello world" ) before running your test.
> minus sign in #set requires spaces to surround it
> -------------------------------------------------
>
> Key: VELOCITY-542
> URL: https://issues.apache.org/jira/browse/VELOCITY-542
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.5
> Reporter: Will Glass-Husain
> Priority: Minor
>
> The following example:
> #set($thisCampNumber = 10)
> #set($nextCampNumber = $thisCampNumber+1)
> #set($previousCampNumber = $thisCampNumber-1)
> #set($previousCampNumberB = $thisCampNumber - 1)
> 1: $thisCampNumber<br>
> 2: $nextCampNumber<br>
> 3: $previousCampNumber<br>
> 4: $previousCampNumberB<br>
> produces this result
> 1: 10
> 2: 11
> 3: $previousCampNumber
> 4: 9
> Note that using a minus sign in a #set statement does not work if there are no spaces around it. (however, the same is not true for +).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Commented: (VELOCITY-542) minus sign in #set requires spaces
to surround it
Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492680 ]
Nathan Bubna commented on VELOCITY-542:
---------------------------------------
I should note that i didn't suggest any course of action, because i'm ambivalent about the state of this. This is a "feature" that i believe few know about or use. While i don't think we should change it in the 1.x series, i wouldn't oppose dropping '-' from the set of valid reference characters in 2.0. Of course, I wouldn't champion that either, so i won't re-open and assign this to that version myself.
> minus sign in #set requires spaces to surround it
> -------------------------------------------------
>
> Key: VELOCITY-542
> URL: https://issues.apache.org/jira/browse/VELOCITY-542
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.5
> Reporter: Will Glass-Husain
> Priority: Minor
>
> The following example:
> #set($thisCampNumber = 10)
> #set($nextCampNumber = $thisCampNumber+1)
> #set($previousCampNumber = $thisCampNumber-1)
> #set($previousCampNumberB = $thisCampNumber - 1)
> 1: $thisCampNumber<br>
> 2: $nextCampNumber<br>
> 3: $previousCampNumber<br>
> 4: $previousCampNumberB<br>
> produces this result
> 1: 10
> 2: 11
> 3: $previousCampNumber
> 4: 9
> Note that using a minus sign in a #set statement does not work if there are no spaces around it. (however, the same is not true for +).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Resolved: (VELOCITY-542) minus sign in #set requires spaces
to surround it
Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Will Glass-Husain resolved VELOCITY-542.
----------------------------------------
Resolution: Won't Fix
ok, guess I'm satisfied with Nathan's explanation.
> minus sign in #set requires spaces to surround it
> -------------------------------------------------
>
> Key: VELOCITY-542
> URL: https://issues.apache.org/jira/browse/VELOCITY-542
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.5
> Reporter: Will Glass-Husain
> Priority: Minor
>
> The following example:
> #set($thisCampNumber = 10)
> #set($nextCampNumber = $thisCampNumber+1)
> #set($previousCampNumber = $thisCampNumber-1)
> #set($previousCampNumberB = $thisCampNumber - 1)
> 1: $thisCampNumber<br>
> 2: $nextCampNumber<br>
> 3: $previousCampNumber<br>
> 4: $previousCampNumberB<br>
> produces this result
> 1: 10
> 2: 11
> 3: $previousCampNumber
> 4: 9
> Note that using a minus sign in a #set statement does not work if there are no spaces around it. (however, the same is not true for +).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org