Igal Sapir
Lucee Core Developer
Lucee.org
--
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/CAHX0TS7hf67-gtnU4BmddJvTnTA0LJyrysAvpz8z1AmAYsUEUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
I'll double check the version but it was from Jordan's installers Friday night.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/556D3842.3080109%40lucee.org.
myList = listToArray("1,2,3,4,5") ;for(item in myList){writeOutput(item);}
--
Not sure why?
Works in ACF and to be honest I did expect it to work in lucee
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/A8BD07DC-4364-4BC7-942F-86E8272CAF09%40gmail.com.
--
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/c6ff073b-dd1d-4c1a-903d-7f567653be13%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAHX0TS56v%3D9XwyZKaM_iNtA8R-vL04RAMEu3X_OWvJX27zCtWA%40mail.gmail.com.
Sorry. Hadn't memorised all tickets.
Still a stupid idea.
--
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/CAG-7QUsKnWbkNpX8OJgBYayo-J5b3N0R_OYR%3DDipFC3ZW9f-yg%40mail.gmail.com.
--
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/2897d86d-f4c5-473c-9348-82a1800a8a49%40googlegroups.com.
I have seen too much crap code using lists
If it is intended be a shorcut for converting string list to an array then it must add a "delimiter" parameter.
return ListUtil.listToArray(o.toString(), ',').getIterator();
Oh boy what have I done!
Lists have always been a part of cfml, can't change that, I would think that it you can cf loop list then for in would also just work.
Yes listToArray was used but it was one extra line if code to type in big deal.
I simply asked if it should work not weather my code is shit.
--
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/a781f472-9cc3-4a5c-9df7-e533755279bd%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAHX0TS5_RoA5t1yfG7Q7%2Bh-EvSw4x3zEKngtL%2BwLBa7YwmaaWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAPURtC0dCbEAT17h1z%2BnfvKbRk_szJGxBHh4ocAiMxLyngi5%2BQ%40mail.gmail.com.
--
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/a275a002-ddab-49fa-a153-258b85d39122%40googlegroups.com.
|
|
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 |
--
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/6e45052d-2348-4510-9ff0-1e0133ad48d6%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/36D01427-0D36-4B28-8B80-95A61B5E012B%40gmail.com.
@Mark --
I personally agree with you, but the driving force behind fixing this issue was ACF compatibility.
if anything, I would prefer
for (ch in someString) { /* ... to iterate over the characters of the string ... */ }
but then compatibility would completely break...
On Tuesday, 2 June 2015 15:09:47 UTC+1, Igal wrote:if anything, I would prefer
for (ch in someString) { /* ... to iterate over the characters of the string ... */ }
I've been mulling over a sensible syntactical tweak to disambiguate between "by list element" and "by char", but drew a blank.
for (element in list[; delimiter[; multi-char]]);
for (char in "abc";null){ // or "" should work too
echo char; //abc
}
--
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/e4b5c137-ff0a-4dd4-8a12-490175bcf5f3%40googlegroups.com.
--
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/e4b5c137-ff0a-4dd4-8a12-490175bcf5f3%40googlegroups.com.
you mean something like:var MaList = new List(“Tahi,Rua,Toru,Wha”);for(s in MaList.each()){}
MaList.listEach(function(x){
});
andvar MaString = “Elvis is the bomb!”;for(c in MaString.each()){}
MaString.each(function(){
});
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/7418F5AA-99BA-4EFB-9D50-E269D7EE8B38%40gmail.com.
--
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/19e5c329-bb7b-4fd9-8ca8-c502cb19c8d9%40googlegroups.com.
for (item in list.split("")) { // loop over chars
}
for (item in list.split(",")) { // loop over list elements
}
for (element in list[; delimiter[; multi-char]]);
for (element in list[; delimiter[; multi-char]]);I would be against that for the same reason that you cannot specify the "step" (eg, every other element) in a for..in array loop.
On Jun 3, 2015 2:35 AM, "Adam Cameron" <camero...@gmail.com> wrote:
>
>
>
> On Tuesday, 2 June 2015 22:22:36 UTC+1, Jesse Shaffer wrote:
>>
>>
>>> for (element in list[; delimiter[; multi-char]]);
>>
>>
>> I would be against that for the same reason that you cannot specify the "step" (eg, every other element) in a for..in array loop.
>
>
> That doesn't quite follow. step is never a feature of for..in loops of any description, because a for..in loop is specifically for iterating over all elements of the collection.
Correct, it is the simplest array loop that follows the most common use case for looping over arrays. You also cannot specify direction or an index.
> The delimiter and multi-char parameters here are necessary to correctly support lists that a) don't use a hard-coded comma delimiter; b) have multi-char delimiters. These are the opposite of the step concept: they are required to facilitate looping over all list elements, not to omit them. However you're in good company (after a fashion)... the Adobe engineers made exactly the same misreading of the situation.
>
It does follow if you expect for..in loops to be simple and *representing the defaults*. The default for a cfloop over a list is that the list be a simple comma-delimited list. Any other needs are addressed with different (arguably better) constructs, of which there are at least 4.
> On the other hand I completely agree that using lists as a "thing" should be frowned up. However I believe that if one is going to support lists, then one should do the job thoroughly. Which has not been done here.
>
Maybe not for this particular construct. However they are already thoroughly supported with other constructs.
This is Adobe's deal. Let them "fix" (preferably drop) it. If they implement something along the lines of what you suggest, then by all means implement that.
Again, I hope all of this doesn't apply to the lucee dialect. I wouldn't mind for..in string. I would, however, expect it to follow the more logical assumption of treating the string as a character array.
> --
> Adam
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/N_zoOEaW2xY/unsubscribe.
> To unsubscribe from this group and all its topics, 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/f845d6b3-470a-46bc-8edb-a28c0b68885d%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAHX0TS7FuSXofjsC2aB%2BQYSvyOyw2fHAtiZcsBgL-KL6JLymNQ%40mail.gmail.com.
> That doesn't quite follow. step is never a feature of for..in loops of any description, because a for..in loop is specifically for iterating over all elements of the collection.
Correct, it is the simplest array loop that follows the most common use case for looping over arrays. You also cannot specify direction or an index.
> The delimiter and multi-char parameters here are necessary to correctly support lists that a) don't use a hard-coded comma delimiter; b) have multi-char delimiters. These are the opposite of the step concept: they are required to facilitate looping over all list elements, not to omit them. However you're in good company (after a fashion)... the Adobe engineers made exactly the same misreading of the situation.
>It does follow if you expect for..in loops to be simple and *representing the defaults*. The default for a cfloop over a list is that the list be a simple comma-delimited list. Any other needs are addressed with different (arguably better) constructs, of which there are at least 4.
Again, I hope all of this doesn't apply to the lucee dialect. I wouldn't mind for..in string. I would, however, expect it to follow the more logical assumption of treating the string as a character array.
if anything, I would prefer
for (ch in someString) { /* ... to iterate over the characters of the string ... */ }