November 10, 2006
Daniel Keep wrote:
> 
> Hasan Aljudy wrote:
>> ...
>> ummmm .. mathematicians use more complicated symbols and notations than
>> programmers.
> 
> It's funny; but the early programming languages were designed by
> mathematicians.  Trust me, if they'd been able to use ∧ for and, and ∨
> for or, they would have :)  On a few systems, they actually *did*.  I
> think programmers use "simpler" notation simply because we're limited to
> what we can bang out on a keyboard, and mathematicians aren't.

I heard a story (possibly apocryphal) that the "\" character was actually added to ASCII because people thought you might want to write \/ for or and /\ for and :).

Max
November 10, 2006
Daniel Keep wrote:
> 
> (In fact, mathematicians seem to *love* inventing new symbols: the guy
> who invented lambda calculus originally wanted to introduce a new
> symbol.  But when it was sent off to be published, the typesetter
> mistook his new symbol for a lambda (λ), and it kinda stuck :P)

I remember when I was first learning Japanese, it occurred to me "Whoa! now I'll never run out of single-character variable names when doing math equations!"

For some reason it didn't actually prove to be that useful, though. Even the Japanese don't use Japanese symbols in their math for some reason, just Roman and Greek letters like everyone else.  Every once in a while I'll use an 「あ」 to represent some big sub-expression that doesn't have much meaning but keeps on re-appearing in derivations.  But that's about it.

--bb
November 10, 2006
Max Bolingbroke wrote:
> Daniel Keep wrote:
> 
>>
>> Hasan Aljudy wrote:
>>
>>> ...
>>> ummmm .. mathematicians use more complicated symbols and notations than
>>> programmers.
>>
>>
>> It's funny; but the early programming languages were designed by
>> mathematicians.  Trust me, if they'd been able to use ∧ for and, and ∨
>> for or, they would have :)  On a few systems, they actually *did*.  I
>> think programmers use "simpler" notation simply because we're limited to
>> what we can bang out on a keyboard, and mathematicians aren't.
> 
> 
> I heard a story (possibly apocryphal) that the "\" character was actually added to ASCII because people thought you might want to write \/ for or and /\ for and :).
> 
> Max

I don't know about logical operators, but it sure is good for making happy stick figures.

  \o/  -- "whee!  D 1.0"
   |
  / \

--bb
November 10, 2006
"Bill Baxter" <wbaxter@gmail.com> wrote in message news:ej2gij$ohu$1@digitaldaemon.com...

> I remember when I was first learning Japanese, it occurred to me "Whoa! now I'll never run out of single-character variable names when doing math equations!"
>
> For some reason it didn't actually prove to be that useful, though. Even the Japanese don't use Japanese symbols in their math for some reason, just Roman and Greek letters like everyone else.  Every once in a while I'll use an ??? to represent some big sub-expression that doesn't have much meaning but keeps on re-appearing in derivations.  But that's about it.

Having taken a few semesters of Japanese, I've noticed I've started to use some kanji in my notes as shorthand :S


November 10, 2006

Jarrett Billingsley wrote:
> "Bill Baxter" <wbaxter@gmail.com> wrote in message news:ej2gij$ohu$1@digitaldaemon.com...
> 
>> I remember when I was first learning Japanese, it occurred to me "Whoa! now I'll never run out of single-character variable names when doing math equations!"
>>
>> For some reason it didn't actually prove to be that useful, though. Even the Japanese don't use Japanese symbols in their math for some reason, just Roman and Greek letters like everyone else.  Every once in a while I'll use an ??? to represent some big sub-expression that doesn't have much meaning but keeps on re-appearing in derivations.  But that's about it.
> 
> Having taken a few semesters of Japanese, I've noticed I've started to use some kanji in my notes as shorthand :S 
> 
> 

Kanji as shorthand? I don't know, I find myself slower when writing kanji (maybe because I'm still a n@@b in that area), but I can write "nihon" faster than I can write 日本, for instance. (I wonder, can utf-8 encode that?)
November 11, 2006
Hasan Aljudy wrote:
> 
> 
> Jarrett Billingsley wrote:
> 
>> "Bill Baxter" <wbaxter@gmail.com> wrote in message news:ej2gij$ohu$1@digitaldaemon.com...
>>
>>> I remember when I was first learning Japanese, it occurred to me "Whoa! now I'll never run out of single-character variable names when doing math equations!"
>>>
>>> For some reason it didn't actually prove to be that useful, though. Even the Japanese don't use Japanese symbols in their math for some reason, just Roman and Greek letters like everyone else.  Every once in a while I'll use an ??? to represent some big sub-expression that doesn't have much meaning but keeps on re-appearing in derivations.  But that's about it.
>>
>>
>> Having taken a few semesters of Japanese, I've noticed I've started to use some kanji in my notes as shorthand :S
>>
> 
> Kanji as shorthand? I don't know, I find myself slower when writing kanji (maybe because I'm still a n@@b in that area), but I can write "nihon" faster than I can write 日本, for instance. (I wonder, can utf-8 encode that?)

Some are simple, like
person,big,small,sun,moon,water,fire,tree,mountain,mother,father...
人 大 小 日 月 水 火 木 山 母 父
And they don't take up much space in your notes, no matter how complex they are. :-)

Anyway, just to bring this slightly back on topic :), since D is utf-8 compatible, I suggest we should allow the use full-width unicode 'and' and 'or' symbols.  :-)

    if ((a∧b)∨(c∧d)) {  ... }

Mmmm Unicode.  That opens up a whole slew of possibilities.
How about opDoubleIntegration?  No problem!
     ∬f(x)dx;
Oooh and we could allow this as a synonym for delete myVar:

     ☠ myVar;

That would surely push D over the top.  Does your language have the skull-and-crossbones operator?  I thought not.
;-)

--bb
November 12, 2006
Bill Baxter wrote:
> Hasan Aljudy wrote:
> 
>>
>>
>> Jarrett Billingsley wrote:
>>
>>> "Bill Baxter" <wbaxter@gmail.com> wrote in message news:ej2gij$ohu$1@digitaldaemon.com...
>>>
>>>> I remember when I was first learning Japanese, it occurred to me "Whoa! now I'll never run out of single-character variable names when doing math equations!"
>>>>
>>>> For some reason it didn't actually prove to be that useful, though. Even the Japanese don't use Japanese symbols in their math for some reason, just Roman and Greek letters like everyone else.  Every once in a while I'll use an ??? to represent some big sub-expression that doesn't have much meaning but keeps on re-appearing in derivations.  But that's about it.
>>>
>>>
>>>
>>> Having taken a few semesters of Japanese, I've noticed I've started to use some kanji in my notes as shorthand :S
>>>
>>
>> Kanji as shorthand? I don't know, I find myself slower when writing kanji (maybe because I'm still a n@@b in that area), but I can write "nihon" faster than I can write 日本, for instance. (I wonder, can utf-8 encode that?)
> 
> 
> Some are simple, like
> person,big,small,sun,moon,water,fire,tree,mountain,mother,father...
> 人 大 小 日 月 水 火 木 山 母 父
> And they don't take up much space in your notes, no matter how complex they are. :-)

Hmm, gotta admit UTF is a Good Thing. Or else we couldn't have this conversation here right now. :-)

> Anyway, just to bring this slightly back on topic :), since D is utf-8 compatible, I suggest we should allow the use full-width unicode 'and' and 'or' symbols.  :-)
> 
>     if ((a∧b)∨(c∧d)) {  ... }

APL guys beware, we're retargeting from C(++) !!

> Mmmm Unicode.  That opens up a whole slew of possibilities.
> How about opDoubleIntegration?  No problem!
>      ∬f(x)dx;
> Oooh and we could allow this as a synonym for delete myVar:
> 
>      ☠ myVar;

Hey, that's the warez operator! The delete symbol is †.

> That would surely push D over the top.  Does your language have the skull-and-crossbones operator?  I thought not.
> ;-)
> 
> --bb
November 13, 2006

Georg Wrede wrote:
> Bill Baxter wrote:
> ...
>> Mmmm Unicode.  That opens up a whole slew of possibilities.
>> How about opDoubleIntegration?  No problem!
>>      ∬f(x)dx;
>> Oooh and we could allow this as a synonym for delete myVar:
>>
>>      ☠ myVar;
> 
> Hey, that's the warez operator! The delete symbol is †.
> 
> ...

Well, you'd just want to make sure you don't get your objects inexplicably being resurrected days later to give you memory leaks.

*ba-dum ching*

Still, I'm surprised no-one has claimed the following gems:

* ☢ - the Radioactive operator (use instead of "volatile"?)
* ☣ - the Biohazard operator (for dirty external declarations?)
* ☭ - the "in Soviet Russia" operator (reverses lexical ordering of next
statement)
* ♨ - the "Hot springs" operator (process goes and takes a break at a
relaxing hot spring, coming back ready and rarin' for some number
crunching!)
* ☃ - the Snowman operator (I... got nothin' on this one)

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/
November 13, 2006
Daniel Keep wrote:
> 
> Georg Wrede wrote:
>> Bill Baxter wrote:
>> ...
>>> Mmmm Unicode.  That opens up a whole slew of possibilities.
>>> How about opDoubleIntegration?  No problem!
>>>      ∬f(x)dx;
>>> Oooh and we could allow this as a synonym for delete myVar:
>>>
>>>      ☠ myVar;
>> Hey, that's the warez operator! The delete symbol is †.
>>
>> ...
> 
> Well, you'd just want to make sure you don't get your objects
> inexplicably being resurrected days later to give you memory leaks.
> 
> *ba-dum ching*

Just need make liberal use of the ☂ operator in that case.

> Still, I'm surprised no-one has claimed the following gems:
> 
> * ☢ - the Radioactive operator (use instead of "volatile"?)
> * ☣ - the Biohazard operator (for dirty external declarations?)
> * ☭ - the "in Soviet Russia" operator (reverses lexical ordering of next
> statement)

Too funny.

> * ♨ - the "Hot springs" operator (process goes and takes a break at a
> relaxing hot spring, coming back ready and rarin' for some number
> crunching!)
> * ☃ - the Snowman operator (I... got nothin' on this one)

It must mean "this variable is frozen", a.k.a. const ??
BTW at 12 points, that looks more like "bill the cat" than a snowman.
@_O -- Ack!

--bb
November 14, 2006
Sean Kelly wrote:
> Bill Baxter wrote:
>> Bill Baxter wrote:
>>> David Qualls wrote:
>>
>>> After 20 years of C/C++ my use of && and || was pretty instinctual, but after just a few months of working with Python on the side I found I started typing 'and' and 'or' without thinking about it.  
>>
>> I think my meaning wasn't so clear so let me rephrase.
>>
>> It took no time to get used to 'and/or' when learning python.  I don't recall ever mistakenly using '&&' in my first few python attempts.  But what happened after a few months (and continues to today) is that I sometimes type 'and/or' in *C++* code (and now *D* too) when I mean &&/||.
>>
>> I think it's just because in my head I'm *thinking* 'if this and that' as I type.  My brain recognizes 'and' as a legal keyword from somewhere and so my fingers type it.
>>
>> Unfortunately, if && and || are to be eliminated wholesale, the benefit will be seen as too small to be worth the pain of fixing all old code. Furthermore Walter believes that C/C++ syntax must be good enough or it wouldn't have survived so long (or something like that).  And he believes that D should look and behave like C/C++ as much as possible to ease the transition for C/C++ refugees (hence the decision to not fix how switch works).  He also believes that symbols (!@#$%^&*) should be used wherever possible instead of new keywords (hence we have ':' showing up everywhere for all kinds of different purposes, and "static" with even more meanings than in C++).
>>
>> It could be possible to add 'and' and 'or' as _synonyms_, but that smacks as too many ways to do the same thing, and adds two keywords for something for which there is already another way to do it.  It doesn't let you do or express anything you couldn't before.
> 
> For what it's worth, 'and' and 'or' as synonyms for '&&' and '||' already exists in C/C++.  Trigraphs are a largely unknown feature that many appear to dislike, but I have read a reasonable argument that they are useful for teaching new programmers.  

What do C trigraphs have to do with 'and' and 'or' as synonyms for '&&' and '||'?


-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D