Lucee Dialect - Strings, quotes and variable expansion

179 views
Skip to first unread message

Chris Blackwell

unread,
Apr 10, 2015, 6:08:05 AM4/10/15
to lu...@googlegroups.com
In CFML a string can be defined with single or double quotes and any #vars# in the string will be expanded

e.g

name = "Chris"
text = "Hi #name#"
echo(text)   // --> Hi Chris

So where you want a # in a string you have to escape it with ##

What if double quotes supported variable expansion, but single quotes did not ?

name = "Chris"
double = "Hi #name#"
single = 'Hi #name#'
echo(double)   // --> Hi Chris
echo(single) // --> Hi #name#

This is slightly different from java where a single quotes are used for character literals, and double quotes for strings, but should be familiar to nix shell users


Michael Offner

unread,
Apr 10, 2015, 1:05:41 PM4/10/15
to lucee
good idea, i would love to hear more opinions on this.

Micha

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAB%3DtfTooR%3Droy-zDbj9bDEFHaLzxRKNguW0MyBTP5n4ZZ64yPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Igal @ Lucee.org

unread,
Apr 10, 2015, 1:14:42 PM4/10/15
to lu...@googlegroups.com
I find single quote escaping to be much more frequent than octothorpe escaping, and the proposal will require to escape single quotes.

C# has a construct in which the @ symbol is used in front of a string to denote that it is verbatim.  I'd rather use something like that so that:

echo( "millisecs since epoch: #getTickCount()#" ); // evaluate the cfml expression

echo( @'to find the millisecs since epoch use "#getTickCount()#"' ); // verbatim string, no evaluation

echo( @"to get the epoch's time use #getTickCount()#" ); // no need to escape apostrophe

Igal Sapir
Lucee Core Developer
Lucee.org

Chris Blackwell

unread,
Apr 10, 2015, 3:46:41 PM4/10/15
to lu...@googlegroups.com
My original thought was that if you could distinguish between strings that needed to be checked for variable expansion, and those that don't, then there might be a potential performance benefit.  I do't know what the over head is or if its significant,  I guess you and Micha would have the best insight there...

would there any performance difference between

s = "Hi #name#";
and
s = "Hi " & name;
or
s = 'Hi ' & name;  
if 'Hi ' is not check for variable expansion

btw, never seen the word "octothorpe" before, very nice :)

Jesse Shaffer

unread,
Apr 10, 2015, 6:14:16 PM4/10/15
to lu...@googlegroups.com
I think I would prefer Igal's suggestion here.

Andrew Dixon

unread,
Apr 10, 2015, 6:41:00 PM4/10/15
to lu...@googlegroups.com
I prefer Igal suggestion as well as it has a clearer meaning than single and double quotes, which most people assume are interchangeable in a lot of situations.

Chris Blackwell

unread,
Apr 11, 2015, 3:53:27 AM4/11/15
to lu...@googlegroups.com

Yeah I like @"String" too.

It could be something that was introduced into lucee for both .cf and .lucee syntaxes as it wouldn't change the behaviour of existing code.


Peter Boughton

unread,
Apr 11, 2015, 8:14:26 AM4/11/15
to lu...@googlegroups.com
I still haven't seen a reason for adding this?

There wont be a runtime benefit since dealing with escaped hashes is
done at compile-time.

And I'm not sure that checking for escaped hashes is significantly more
effort than escaped quotes - I'm assuming double quotes are escapable -
i.e. the following are all equivalent:

@"A string with # and "" in it"
"A string with ## and "" in it"
'A string with ## and " in it'

Is escaping hashes a big enough issue to justify adding complexity to
the language/compiler?

(That's a genuine question, not rhetorical - it's never been an issue
for me, but of course others may have different problems...)

Sid Wing

unread,
Apr 11, 2015, 9:02:07 AM4/11/15
to lu...@googlegroups.com, lu...@sorcerersisle.com
+1 for Igal

Alex Skinner

unread,
Apr 11, 2015, 9:09:18 AM4/11/15
to lu...@googlegroups.com

I'm not against the idea but would love to see a prioritised issue list. I'm not sure this is problem I feel needs solving

A

Sent from my phone

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Chris Blackwell

unread,
Apr 11, 2015, 9:11:49 AM4/11/15
to lu...@googlegroups.com

I completely agree, but discussing whether it's something we want vs prioritising and scheduling the work are different things entirely.


Igal Sapir

unread,
Apr 11, 2015, 10:49:55 AM4/11/15
to lu...@googlegroups.com

On Apr 11, 2015 06:11, "Chris Blackwell" <ch...@team193.com> wrote:
>
> I completely agree, but discussing whether it's something we want vs prioritising and scheduling the work are different things entirely.

+1

> To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAB%3DtfTpP3dKuar16sXLVEvvXyb9_1jh_VC0J_k_bdwRqhpi3ng%40mail.gmail.com.

Dan Kraus

unread,
Apr 11, 2015, 11:31:15 AM4/11/15
to lu...@googlegroups.com
I think I'd only advocate it if there's a performance benefit. I know other languages support string interpolation with one specific quote scheme but I've always found it a bit undeeded personally. It's a layer of complexity to remember which is which and you're already likely in a habit of using one or the other. Escaping is already obvious anyway.

If not performance, what's the benefit? I guess you'd need to run a benchmark of a whole bunch of strings with and without interpolation, and string concatenation against parsing for the quoting scheme. If there's no or negligble difference in performance in escaping octothorpes vs literal string use with no interpolation checking, why bother?

Michael Offner

unread,
Apr 11, 2015, 3:29:55 PM4/11/15
to lu...@googlegroups.com
Performance wise this makes no difference at runtime, because the compiler does the same bytecode for this different syntax. For me there is also one problem with this I have a lot code like this.

Str='<input type="#t#" ...>';

Of course this is also possible with double quotes but with sq it is easier and better readable 

Micha

Peter Boughton

unread,
Apr 12, 2015, 6:54:32 AM4/12/15
to lu...@googlegroups.com
> discussing whether it's something we want vs prioritising
> and scheduling the work are different things entirely.

Simply discussing things people say they want - without a clear why -
is at risk of drifting into PHP pandemonium and cfclient nonsense.

A better way is to present things in terms of "I have problem X. Fixing
this would involve A, B, C. What about solution Y?" and then having a
discussion where ideas pop out. This might involve someone else saying
"My similar issue needs A, C, E, and solution Z might solve both our
problems." or whatever. It might even be solvable with existing
functionality.

My point being that such discussions should be backed by some purpose -
something that can result in saying "we added Y to fix X" instead of
"here's a new thing that you may or not want".

Igal @ Lucee.org

unread,
Apr 13, 2015, 11:50:39 AM4/13/15
to lu...@googlegroups.com
> My point being that such discussions should be backed by some purpose -
> something that can result in saying "we added Y to fix X" instead of
> "here's a new thing that you may or not want".
I disagree.

discussions like "I have an idea... what do you guys think?" are totally
valid and should be encouraged IMO.

Adam Cameron

unread,
Apr 13, 2015, 5:20:36 PM4/13/15
to lu...@googlegroups.com, lu...@sorcerersisle.com


On Saturday, 11 April 2015 13:14:26 UTC+1, Peter Boughton wrote:
I still haven't seen a reason for adding this?

I've come to this thread late (just now), and this was kinda my feeling too.

What *real* issue is being addressed by this suggestion? How is it an improvement over the way CFML already interpolates strings / escapes expressions from being evaluated?

I'm not suggesting there aren't any, I they're just not immediately obvious to me.

-- 
Adam

Michael Offner

unread,
Apr 13, 2015, 8:33:15 PM4/13/15
to lu...@googlegroups.com
I also agree, I don't really see a benefit in it ...

Micha
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Alex Skinner

unread,
Apr 14, 2015, 3:47:02 AM4/14/15
to lu...@googlegroups.com

To me I agree that I don't see the point but also with Igal that there is nothing wrong with people discussing it

To be honest I think the google mailing list is a dismal failure in terms of segmentation of discussions into buckets.  Everything gets jumped on because everything has equal sign posting nothing has a context. And as a tool to foster cohesion within any sort of grouping or context it's just shite.

I think we frankly jumped the gun due to popular opinion regarding how bad discourse was.

As the supporters list had next to no activity I suggest we start by moving that back on discourse. That way we have a better tool for people that are prepared to work with it and see the benefit

Alex

Sent from my phone

Michael Offner

unread,
Apr 14, 2015, 4:02:10 AM4/14/15
to lu...@googlegroups.com
i think that is a very interesting idea ...


Adam Cameron

unread,
Apr 14, 2015, 4:12:16 AM4/14/15
to lu...@googlegroups.com


On Tuesday, 14 April 2015 08:47:02 UTC+1, Alex Skinner wrote:

To be honest I think the google mailing list is a dismal failure in terms of segmentation of discussions into buckets.  Everything gets jumped on because everything has equal sign posting nothing has a context. And as a tool to foster cohesion within any sort of grouping or context it's just shite.


I don't think this is a problem with the tool, it's a problem with the way people are using it. Your own response here is a case in point: you just barged your way into another thread to discuss something completely different, whereas starting a new thread is perhaps what you ought to have done. You're not alone in this, and I don't doubt people will do exactly the same thing if we were using Discourse. People just need to think more about what they're discussing, and whether it's actually relevant to the thread topic.

That said, if you want to trial Discourse again, the other list might be a good place to start. However it'll be difficult to gauge how it will work as the list has close to zero participation, so how would we know if it was successful?

TBH, I don't actually think Google Groups is the problem nor is Discourse is the answer (and I am not positioning this as anti-Discourse), I think ppl paying attention to what they're doing a bit more might be the answer?

-- 
Adam





Andrew Dixon

unread,
Apr 14, 2015, 4:51:18 AM4/14/15
to lu...@googlegroups.com
I agree.

Kind regards,

Andrew
about.me
mso - Lucee - Member

Andrew Dixon

unread,
Apr 14, 2015, 4:54:07 AM4/14/15
to lu...@googlegroups.com
Hi Adam,

I don't think you are ever going to get people to pay more attention to what they are doing but I believe with Discourse (admiitting here I don't really know it well) the admin/moderator has more of an opportunity to manage the conversation, more stuff into new topics where required, etc... unlike Google Groups that doesn't allow for this.

Kind regards,

Andrew
about.me
mso - Lucee - Member

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Adam Cameron

unread,
Apr 14, 2015, 5:01:20 AM4/14/15
to lu...@googlegroups.com


On Tuesday, 14 April 2015 09:54:07 UTC+1, Andrew Dixon wrote:

I don't think you are ever going to get people to pay more attention to what they are doing

Well: no. But one can dream, yeah? ;-)

 
but I believe with Discourse (admiitting here I don't really know it well) the admin/moderator has more of an opportunity to manage the conversation, more stuff into new topics where required, etc... unlike Google Groups that doesn't allow for this.


Aha, that makes sense.

-- 
Adam

Nando Breiter

unread,
Apr 14, 2015, 5:05:44 AM4/14/15
to lu...@googlegroups.com
Adam made me pay more attention to what I was doing, once or twice, I think ... ;-)




Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Adam Cameron

unread,
Apr 14, 2015, 5:17:30 AM4/14/15
to lu...@googlegroups.com


On Tuesday, 14 April 2015 10:05:44 UTC+1, Nando Breiter wrote:
Adam made me pay more attention to what I was doing, once or twice, I think ... ;-)

Come on Nando, don't encourage me.

;-)

-- 
Adam

Sean Corfield

unread,
Apr 14, 2015, 12:03:28 PM4/14/15
to lu...@googlegroups.com
On Apr 14, 2015, at 1:12 AM, Adam Cameron <camero...@gmail.com> wrote:
> You're not alone in this, and I don't doubt people will do exactly the same thing if we were using Discourse. People just need to think more about what they're discussing, and whether it's actually relevant to the thread topic.

Indeed. I follow the Rust language Discourse forums (in digest mode because the email threading is so appalling in Discourse, and because I don’t need to be involved with many threads), and they do indeed have threads going off the rails and metathreads starting in the middle of other threads about whether the discussion is happening in the right place or not. And they still have ad hominem disagreements too. And it’s all getting worse as traffic increases (it was really pretty good when the traffic was very low — and it still works, mostly, for the internals discussions). Oh, and there are still complaints about it not being a normal mailing list — so if Rust gets popular it’ll be interesting to see how that plays out.

So, yes, overall, Adam is (unfortunately) right that Google Groups is not the problem, nor would Discourse be the answer. People are the problem :(

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)



Alex Skinner

unread,
Apr 14, 2015, 4:44:44 PM4/14/15
to lu...@googlegroups.com

OK Sean well if you say so.

But as this not a statement of fact but an opinion I'll keep mine.

And also vote with my feet. 

Alex

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Adam Cameron

unread,
Apr 14, 2015, 5:16:22 PM4/14/15
to lu...@googlegroups.com
On Tuesday, 14 April 2015 17:03:28 UTC+1, Sean Corfield wrote:
So, yes, overall, Adam is (unfortunately) right that Google Groups is not the problem, nor would Discourse be the answer. People are the problem :( 

Whilst maybe true (although Alex doesn't seem to think so, and his position won't have come from nowhere), we can do something about the software; realistically we can't do anything about the people [cough, I'm a fine example].

In that light, I don't see the harm in piloting another system in a restricted audience, to see if it helps things. I suggest "restricted audience" only cos we're already messed the community around twice with forum-software indecision, so perhaps piloting something for a reasonable length of time before simply reacting to people whinging might be something to try out. And there is already a second small-audience forum to try it on. I'll do my bit by trying to come up with things to talk about on it ;-)
 
But it should be treated like an experimental pilot, and be open-minded as to whether it actually solves anything. I mean this from both directions of the "argument".

On Tuesday, 14 April 2015 21:44:44 UTC+1, Alex Skinner wrote:

OK Sean well if you say so.

But as this not a statement of fact but an opinion I'll keep mine.

And also vote with my feet. 


That sounds pretty petulant, mate. Sean in no way suggested anything he was saying was anything other than his opinion/topical observations, not did he suggest it held any more weight than anyone else's. On the other hand it does seem like he's got experience with another similar environment with similar problems trying a similar solution. So why would we not... you know... take on board what he has to say?

Why are we making such a sport out of getting so uppity when someone doesn't simply agree with what we say?? Isn't the whole raison d'etre of a forum to... treat it like a forum: discussing disparate opinions so our conclusions are mutually improved?

-- 
Adam 

Sean Corfield

unread,
Apr 14, 2015, 6:11:10 PM4/14/15
to lu...@googlegroups.com
On Apr 14, 2015, at 2:16 PM, Adam Cameron <camero...@gmail.com> wrote:
On Tuesday, 14 April 2015 21:44:44 UTC+1, Alex Skinner wrote:

[snip]

That sounds pretty petulant, mate. Sean in no way suggested anything he was saying was anything other than his opinion/topical observations, not did he suggest it held any more weight than anyone else's. On the other hand it does seem like he's got experience with another similar environment with similar problems trying a similar solution. So why would we not... you know... take on board what he has to say?

And I pointed out that Rust’s Discourse forum was mostly fine for the internal (low-traffic) discussions! My observation was that it wasn’t working so well as communication scaled — and the Rust folks have made a huge effort to create a culture where Reddit and StackOverflow are considered the "right place" to go for announcements (and discussions thereof) and questions respectively, deliberately trying to keep Discourse traffic lower.

I would expect Discourse to work for LAS internally — the Members and Supporters stuff — since that will be lower traffic and likely to be much more structured.

Isn't the whole raison d'etre of a forum to... treat it like a forum: discussing disparate opinions so our conclusions are mutually improved?

Some people here don’t seem to like disparate opinions…

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



Alex Skinner

unread,
Apr 14, 2015, 6:26:37 PM4/14/15
to lu...@googlegroups.com
Adam,

Well I disagree I don't think anything I said was uppity, I don't think the response made any attempt to actually understand the point that I was making. So my response I guess could be best described as irritated.

Look we all know that many participants have many years experience of committees and groups but sometimes people spend longer telling each other how experienced they are rather than taking a step back and making a genuine attempt to understand the issue being expressed. I'd like it if people took that many year experience and constructively offered a solution.

Now I'm not suggesting Discourse is the only solution but I feel there is a problem and not one that can be addressed by saying ahh people aye, yeah people what can you do.  

We need something that helps create a structure, so I intend to use Discourse it's there let's see how it goes.  I'm not suggesting the main list I said clearly the supporters list which has no traffic so really be a mute point. 

The issue is for me that google groups is a poorly threaded single context discussion. There is no weighting and perhaps there shouldn't be but it has nothing in it to help you out of box with focusing on particular slants depending on your interest or actually spotting or connecting with the stuff that most interests you.

My issue is that, hey I've got this idea for X is equally sign posted to a request from the project members/coordinators for volunteers to help with documentation, or hey we need volunteers for the website either writing copy or proof reading, What does the now() function do. My lucee won't install.

All of these are equally valid but in the glut of email I know stuff gets lost and I spend a fair amount of more time that is probably healthy and still miss stuff.

This isn't about particular voices having more volume and let's not start with the whole people don't like disparate opinions nonsense it's entirely irrelevant. Validating a concern is not the same as agreeing with the solution.

Google groups works for a chat but there is a gap, and as one of the group of people trying to work less chaotically to push things forward I definitely feel it acutely. 

Suggestions more than welcome but just saying we're all fucked because we're people, is for clarification less than helpful.

Thanks

Alex

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alex Skinner
Managing Director

Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom



T: +44 [0] 845 260 0726 W: www.pixl8.co.uk E: in...@pixl8.co.uk




Follow us on: Facebook Twitter LinkedIn



CONFIDENTIAL AND PRIVILEGED - This e-mail and any attachment is intended solely for the addressee, is strictly confidential and may also be subject to legal, professional or other privilege or may be protected by work product immunity or other legal rules. If you are not the addressee please do not read, print, re-transmit, store or act in reliance on it or any attachments. Instead, please email it back to the sender and then immediately permanently delete it. Pixl8 Interactive Ltd Registered in England. Registered number: 04336501. Registered office: 8 Spur Road, Cosham, Portsmouth, Hampshire, PO6 3EB

Reply all
Reply to author
Forward
0 new messages