Jump to page: 1 24  
Page
Thread overview
Differentiate const flavors using CASE?
Mar 21, 2007
Bill Baxter
Mar 21, 2007
Derek Parnell
Mar 22, 2007
Benji Smith
Mar 22, 2007
Derek Parnell
Mar 22, 2007
Daniel Keep
Mar 22, 2007
David B. Held
Mar 22, 2007
Pragma
Mar 22, 2007
Ary Manzana
Mar 22, 2007
Tom
Mar 22, 2007
janderson
Mar 22, 2007
kris
Re: [OT] foreach(scheme) (Was: Differentiate const flavors using CASE?)
Mar 22, 2007
Daniel Keep
Mar 22, 2007
kris
Mar 22, 2007
Daniel Keep
Mar 22, 2007
Deewiant
Mar 22, 2007
janderson
Mar 22, 2007
Oskar Linde
Mar 23, 2007
Bruno Medeiros
Mar 22, 2007
kris
Mar 22, 2007
Daniel Keep
Mar 22, 2007
kris
Mar 22, 2007
janderson
Mar 22, 2007
janderson
Mar 22, 2007
Reiner Pope
Mar 22, 2007
Dan
Mar 23, 2007
Derek Parnell
March 21, 2007
Here's a random thought:
What about const vs CONST?
The upcase version obviously being the more const of the two.
The original proposal played with punctuation, and we've talked plenty about spelling, but we haven't talked about playing with case.  It would be an odd-ball among keywords, admittedly, but if you asked 100 people which of 'const' and 'CONST' was the most constant you'd probably get 100 votes for 'CONST'.  And he could become good friends with foreach_reverse, the other odd-ball keyword who is disparaged by the other kids because of his obesity and the big staple in his belly button.

---bb
March 21, 2007
On Thu, 22 Mar 2007 04:53:26 +0900, Bill Baxter wrote:

> Here's a random thought:
> What about const vs CONST?
> The upcase version obviously being the more const of the two.
> The original proposal played with punctuation, and we've talked plenty
> about spelling, but we haven't talked about playing with case.  It would
> be an odd-ball among keywords, admittedly, but if you asked 100 people
> which of 'const' and 'CONST' was the most constant you'd probably get
> 100 votes for 'CONST'.  And he could become good friends with
> foreach_reverse, the other odd-ball keyword who is disparaged by the
> other kids because of his obesity and the big staple in his belly button.

LOL ... Now that *is* funny.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Justice for David Hicks!"
22/03/2007 9:32:04 AM
March 21, 2007
Derek Parnell wrote:
> On Thu, 22 Mar 2007 04:53:26 +0900, Bill Baxter wrote:
> 
>> Here's a random thought:
>> What about const vs CONST?
>> The upcase version obviously being the more const of the two.
>> The original proposal played with punctuation, and we've talked plenty about spelling, but we haven't talked about playing with case.  It would be an odd-ball among keywords, admittedly, but if you asked 100 people which of 'const' and 'CONST' was the most constant you'd probably get 100 votes for 'CONST'.  And he could become good friends with foreach_reverse, the other odd-ball keyword who is disparaged by the other kids because of his obesity and the big staple in his belly button.
> 
> LOL ... Now that *is* funny.

Yah :o). Speaking of foreach_reverse, probably it would be wise to lobby Walter to deprecate it in favor of foreach(reverse) (item ; collection) { ... }. The keyword(extra) syntax is definitely becoming a D signature syntax.


Andrei
March 22, 2007
Andrei Alexandrescu (See Website For Email) wrote:
> Derek Parnell wrote:
>> On Thu, 22 Mar 2007 04:53:26 +0900, Bill Baxter wrote:
>>
>>> Here's a random thought:
>>> What about const vs CONST?
>>> The upcase version obviously being the more const of the two.
>>> The original proposal played with punctuation, and we've talked plenty about spelling, but we haven't talked about playing with case.  It would be an odd-ball among keywords, admittedly, but if you asked 100 people which of 'const' and 'CONST' was the most constant you'd probably get 100 votes for 'CONST'.  And he could become good friends with foreach_reverse, the other odd-ball keyword who is disparaged by the other kids because of his obesity and the big staple in his belly button.
>>
>> LOL ... Now that *is* funny.
> 
> Yah :o). Speaking of foreach_reverse, probably it would be wise to lobby Walter to deprecate it in favor of foreach(reverse) (item ; collection) { ... }. The keyword(extra) syntax is definitely becoming a D signature syntax.
> 
> 
> Andrei

What do you call that little non-keyword in parens when you refer to it in your parsing code? If it's not a keyword or an operator or an identifier, how do you refer to it?

Just curious.

--benji
March 22, 2007
Benji Smith wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> Derek Parnell wrote:
>>> On Thu, 22 Mar 2007 04:53:26 +0900, Bill Baxter wrote:
>>>
>>>> Here's a random thought:
>>>> What about const vs CONST?
>>>> The upcase version obviously being the more const of the two.
>>>> The original proposal played with punctuation, and we've talked plenty about spelling, but we haven't talked about playing with case.  It would be an odd-ball among keywords, admittedly, but if you asked 100 people which of 'const' and 'CONST' was the most constant you'd probably get 100 votes for 'CONST'.  And he could become good friends with foreach_reverse, the other odd-ball keyword who is disparaged by the other kids because of his obesity and the big staple in his belly button.
>>>
>>> LOL ... Now that *is* funny.
>>
>> Yah :o). Speaking of foreach_reverse, probably it would be wise to lobby Walter to deprecate it in favor of foreach(reverse) (item ; collection) { ... }. The keyword(extra) syntax is definitely becoming a D signature syntax.
>>
>>
>> Andrei
> 
> What do you call that little non-keyword in parens when you refer to it in your parsing code? If it's not a keyword or an operator or an identifier, how do you refer to it?
> 
> Just curious.

Some call it "contextual keyword".

Andrei
March 22, 2007
On Wed, 21 Mar 2007 17:33:00 -0700, Benji Smith wrote:

> Andrei Alexandrescu (See Website For Email) wrote:
>> Derek Parnell wrote:
>>> On Thu, 22 Mar 2007 04:53:26 +0900, Bill Baxter wrote:
>>>
>>>> Here's a random thought:
>>>> What about const vs CONST?
>>>> The upcase version obviously being the more const of the two.
>>>> The original proposal played with punctuation, and we've talked
>>>> plenty about spelling, but we haven't talked about playing with
>>>> case.  It would be an odd-ball among keywords, admittedly, but if you
>>>> asked 100 people which of 'const' and 'CONST' was the most constant
>>>> you'd probably get 100 votes for 'CONST'.  And he could become good
>>>> friends with foreach_reverse, the other odd-ball keyword who is
>>>> disparaged by the other kids because of his obesity and the big
>>>> staple in his belly button.
>>>
>>> LOL ... Now that *is* funny.
>> 
>> Yah :o). Speaking of foreach_reverse, probably it would be wise to lobby Walter to deprecate it in favor of foreach(reverse) (item ; collection) { ... }. The keyword(extra) syntax is definitely becoming a D signature syntax.
>> 
>> Andrei
> 
> What do you call that little non-keyword in parens when you refer to it in your parsing code? If it's not a keyword or an operator or an identifier, how do you refer to it?
> 
> Just curious.

An adornment/ornamentation/embellishment maybe?

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Justice for David Hicks!"
22/03/2007 11:45:23 AM
March 22, 2007

Derek Parnell wrote:
> On Wed, 21 Mar 2007 17:33:00 -0700, Benji Smith wrote:
> 
>> Andrei Alexandrescu (See Website For Email) wrote:
>>> Derek Parnell wrote:
>>>> On Thu, 22 Mar 2007 04:53:26 +0900, Bill Baxter wrote:
>>>>
>>>>> Here's a random thought:
>>>>> What about const vs CONST?
>>>>> The upcase version obviously being the more const of the two.
>>>>> The original proposal played with punctuation, and we've talked
>>>>> plenty about spelling, but we haven't talked about playing with
>>>>> case.  It would be an odd-ball among keywords, admittedly, but if you
>>>>> asked 100 people which of 'const' and 'CONST' was the most constant
>>>>> you'd probably get 100 votes for 'CONST'.  And he could become good
>>>>> friends with foreach_reverse, the other odd-ball keyword who is
>>>>> disparaged by the other kids because of his obesity and the big
>>>>> staple in his belly button.
>>>> LOL ... Now that *is* funny.
>>> Yah :o). Speaking of foreach_reverse, probably it would be wise to lobby Walter to deprecate it in favor of foreach(reverse) (item ; collection) { ... }. The keyword(extra) syntax is definitely becoming a D signature syntax.
>>>
>>> Andrei
>> What do you call that little non-keyword in parens when you refer to it in your parsing code? If it's not a keyword or an operator or an identifier, how do you refer to it?
>>
>> Just curious.
> 
> An adornment/ornamentation/embellishment maybe?

We could always call them "ruby keywords"[1], and just annoy the hell out of ruby users >:)

	-- Daniel

[1] The phrase being stolen from the idea of "ruby text": small additional text written beside Japanese kanji which helps disambiguate them; pretty much exactly what these things are doing :)

-- 
int getRandomNumber()
{
    return 4; // chosen by fair dice roll.
              // guaranteed to be random.
}

http://xkcd.com/

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/
March 22, 2007
Andrei Alexandrescu (See Website For Email) escribió:
> Derek Parnell wrote:
>> On Thu, 22 Mar 2007 04:53:26 +0900, Bill Baxter wrote:
>>
>>> Here's a random thought:
>>> What about const vs CONST?
>>> The upcase version obviously being the more const of the two.
>>> The original proposal played with punctuation, and we've talked plenty about spelling, but we haven't talked about playing with case.  It would be an odd-ball among keywords, admittedly, but if you asked 100 people which of 'const' and 'CONST' was the most constant you'd probably get 100 votes for 'CONST'.  And he could become good friends with foreach_reverse, the other odd-ball keyword who is disparaged by the other kids because of his obesity and the big staple in his belly button.
>>
>> LOL ... Now that *is* funny.
> 
> Yah :o). Speaking of foreach_reverse, probably it would be wise to lobby Walter to deprecate it in favor of foreach(reverse) (item ; collection) { ... }. The keyword(extra) syntax is definitely becoming a D signature syntax.
> 
> 
> Andrei

I've actually started to like foreach_reverse. I most of the time program in Java and, you know, Java 1.5 has foreach:

foreach(String s : words) {
}

I use it very widely, trying not to do a loop with a counter to avoid typing more and to avoid bugs. But then I had to write an algorithm that iterated the array backwards, and if I only had foreach_reverse the code would have been clean and nice...

Of course, sometimes you have to iterate other ways, but foward and backwards are way too common.
March 22, 2007
Ary Manzana escribió:
> Andrei Alexandrescu (See Website For Email) escribió:
>> Derek Parnell wrote:
>>> On Thu, 22 Mar 2007 04:53:26 +0900, Bill Baxter wrote:
>>>
>>>> Here's a random thought:
>>>> What about const vs CONST?
>>>> The upcase version obviously being the more const of the two.
>>>> The original proposal played with punctuation, and we've talked plenty about spelling, but we haven't talked about playing with case.  It would be an odd-ball among keywords, admittedly, but if you asked 100 people which of 'const' and 'CONST' was the most constant you'd probably get 100 votes for 'CONST'.  And he could become good friends with foreach_reverse, the other odd-ball keyword who is disparaged by the other kids because of his obesity and the big staple in his belly button.
>>>
>>> LOL ... Now that *is* funny.
>>
>> Yah :o). Speaking of foreach_reverse, probably it would be wise to lobby Walter to deprecate it in favor of foreach(reverse) (item ; collection) { ... }. The keyword(extra) syntax is definitely becoming a D signature syntax.
>>
>>
>> Andrei
> 
> I've actually started to like foreach_reverse. I most of the time program in Java and, you know, Java 1.5 has foreach:
> 
> foreach(String s : words) {
> }

Actually, I think it is:

for (String s: words) {
}

So it was that they didn't add the 'foreach' keyword to preserve backward compatibility... which I find pretty ridiculous (but I could be wrong) :)

--
Tom;
March 22, 2007
Andrei Alexandrescu (See Website For Email) wrote:
> Derek Parnell wrote:
>> On Thu, 22 Mar 2007 04:53:26 +0900, Bill Baxter wrote:
>>
>>> Here's a random thought:
>>> What about const vs CONST?
>>> The upcase version obviously being the more const of the two.
>>> The original proposal played with punctuation, and we've talked plenty about spelling, but we haven't talked about playing with case.  It would be an odd-ball among keywords, admittedly, but if you asked 100 people which of 'const' and 'CONST' was the most constant you'd probably get 100 votes for 'CONST'.  And he could become good friends with foreach_reverse, the other odd-ball keyword who is disparaged by the other kids because of his obesity and the big staple in his belly button.
>>
>> LOL ... Now that *is* funny.
> 
> Yah :o). Speaking of foreach_reverse, probably it would be wise to lobby Walter to deprecate it in favor of foreach(reverse) (item ; collection) { ... }. The keyword(extra) syntax is definitely becoming a D signature syntax.
> 
> 
> Andrei

//Using your other suggestion:
foreach(reverse) (item ; collection) (item2 ; x->GetColection(b)) (item3 ; collection3)
{

}

Its starting to get hard and harder to read IMO.

Although perhaps the reverse could be come sort of iterator mechanism. You could define what order items are visited.  I mean, reverse would not be a keyword at all and would exist in some library.  Although I'm not sure how it would be implemented, and it may defeat the purpose of foreach_reverse being optimal.

Just a thought.
« First   ‹ Prev
1 2 3 4