Re: [railo] Variable Name Causing Error. Why?

62 views
Skip to first unread message

Mark Drew

unread,
Aug 20, 2012, 1:51:22 PM8/20/12
to ra...@googlegroups.com
I think it's something to do with the NOT in the front of the array maybe? I am sure it's an oddity in the parser it seems since this also works:
<cfset no2RegisterArray = arrayNew(2)>

Very very odd.

I shall add a bug for it

Mark Drew

Railo Technologies Professional Open Source
skype: mark_railo ma...@getrailo.com
+44 7971 852296 http://www.getrailo.com

On 20 Aug 2012, at 18:04, Steve Moore <moo...@co.larimer.co.us> wrote:

> I'm new to Railo, so may not understand something (been using CF for 10+ years), but why does statement 1 give me the error "string tag [cfset] is not closed", but statement 2 runs fine?
>
> 1) <cfset not2RegisterArray = arrayNew(2)>
>
> 2) <cfset notToRegisterArray = arrayNew(2)>
>

Michael Offner

unread,
Aug 22, 2012, 9:21:45 AM8/22/12
to ra...@googlegroups.com
not is a keyword in cfml
take this example:
<cfset test=true>
<cfif not test></cfif>

"problem" is that the space after the not is optinal when there is no letter following.

example:
<cfif not 2></cfif>
same as 
<cfif not2></cfif>

in ACF this space is required for "not", that is the difference.

/micha



2012/8/20 Mark Drew <ma...@getrailo.com>



--
/micha

Michael Offner CTO Railo Technologies GmbH

Charlie Griefer

unread,
Aug 22, 2012, 10:16:45 AM8/22/12
to ra...@googlegroups.com
On Wed, Aug 22, 2012 at 6:21 AM, Michael Offner <mic...@getrailo.com> wrote:
> not is a keyword in cfml
> take this example:
> <cfset test=true>
> <cfif not test></cfif>
>
> "problem" is that the space after the not is optinal when there is no letter
> following.
>
> example:
> <cfif not 2></cfif>
> same as
> <cfif not2></cfif>
>
> in ACF this space is required for "not", that is the difference.

Is that not a bug in Railo, then? Sounds like you're saying that's
just a difference between ACF and Railo, and that it's intended
behavior. Are there actually use cases where a developer _wouldn't_
want to use the space?

--
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love
my wife. And I wish you my kind of success.

Michael Offner

unread,
Aug 22, 2012, 10:44:55 AM8/22/12
to ra...@googlegroups.com
you can consider this as a bug, mark has already open a ticket for this:

the reason is that the space between the operator and the oprand is always optional if possible like for example with the alias of "not":
<cfif !test> ...
in this case the space is also optional.
i just try to explain why this happen, i had no intention to say this is correct.

/micha

2012/8/22 Charlie Griefer <charlie...@gmail.com>

Charlie Griefer

unread,
Aug 22, 2012, 10:48:12 AM8/22/12
to ra...@googlegroups.com
On Wed, Aug 22, 2012 at 7:44 AM, Michael Offner <mic...@getrailo.com> wrote:
> you can consider this as a bug, mark has already open a ticket for this:
> https://issues.jboss.org/browse/RAILO-2038
>
> the reason is that the space between the operator and the oprand is always
> optional if possible like for example with the alias of "not":
> <cfif !test> ...
> in this case the space is also optional.
> i just try to explain why this happen, i had no intention to say this is
> correct.

Ah, understood. The "!test" example makes perfect sense. Appreciate
the explanation.

Hendrik Kramer

unread,
Aug 22, 2012, 1:48:34 PM8/22/12
to ra...@googlegroups.com
One small thing: If you fix this bug, please still allow  <cfif !len(...)> without a whitespace inbetween; otherwise I had to change a lot of code.

Charlie Griefer

unread,
Aug 22, 2012, 1:59:00 PM8/22/12
to ra...@googlegroups.com
Heh. Agreed with Hendrik.

<cfif !foo>
<cfif not foo>

Gotta say tho, not a real big fan of <cfif ! foo>.
People do that? (not judging... just asking. really!) :)

Michael Offner

unread,
Aug 23, 2012, 2:51:16 AM8/23/12
to ra...@googlegroups.com
sure, this change will not affect any other operator!

/micha

2012/8/22 Hendrik Kramer <hendrik...@gmail.com>

One small thing: If you fix this bug, please still allow  <cfif !len(...)> without a whitespace inbetween; otherwise I had to change a lot of code.
Reply all
Reply to author
Forward
0 new messages