View mode: basic / threaded / horizontal-split · Log in · Help
April 04, 2006
Re: not operator operator..
>> code is supposed to be beautiful.
>
> code is not supposed to be english, it's supposed to be code.
> code _is_ beautiful, english is not.

Clearly you've never read Yeats, Auden or Eliot. Frankly they make English 
more beautiful than any code I've seen.
April 04, 2006
Re: not operator operator..
Anders F Björklund wrote:
> S. Chancellor wrote:
> 
>> I didn't say I wanted to program in AppleScript. :P  I hate mixing
>> symbols and words.  This is terrible.  I'd rather redefine all the
>> equal set and comparison operators.  The whole point of the 
>> is-operator is equivalence, unfortunately there's no triple bar
>> symbol.
> 
> Sure there is. ≡ in Unicode (\u2261), or === in plain ASCII. It's
> just that it was removed from the language in DMD 0.126 ?

If D really _demands_ source code to be in UTF, then there is no excuse 
for avoiding single-character operators like "≡".

Further, if a computer system is able to provide this UTF character set 
for source code writing, then one is _allowed_ to assume it can print 
them on the printer, too.

Therefore, it is incongruous to avoid these characters as potential 
operators, while still demanding that D only be implemented on 32-bit 
systems. (We really can assume that from today on, any system purporting 
to be 32-bit, supports at least UTF.)

---

One neat detail in the language definition would be that any "non 
US-ASCII" single or double character "operator" may actually be defined 
by the user, or in a custom library.

Of course, any well-defined counter argumets are invited here.
April 04, 2006
Re: not operator operator..
Lars Ivar Igesund wrote:
> Mike Parker wrote:
> 
> 
>>S. Chancellor wrote:
>>
>>>I really really hate the !in, !is syntax.
>>
>>I don't. I actually quite like it.
>>
>>
>>>I propose that the word not, become an operator on
>>>operators.
>>
>>I sure hope it doesn't.
> 
> 
> I agree with Mike here. On both accounts.

So do I.
April 04, 2006
Re: not operator operator..
On Tue, 4 Apr 2006 23:13:29 +0100, John C <johnch_atms@hotmail.com> wrote:
>>> code is supposed to be beautiful.
>>
>> code is not supposed to be english, it's supposed to be code.
>> code _is_ beautiful, english is not.
>
> Clearly you've never read Yeats, Auden or Eliot. Frankly they make  
> English more beautiful than any code I've seen.

In visual appearance or actual meaning? I think code and writing can be  
compared in similar terms, i.e. does it get it's point across, does it do  
so elegantly, etc. However the actualy thing you measure to detemine those  
factors is different in each case. i.e. in the case of code whitespace in  
the right places can make the point of the code clearer.. I think it has  
less impact on writing. I could be wrong.

In either case I think OP was referring to visual appearance of the actual  
characters in combination. This is obviously affected by the font used (as  
I suggested in another post) and (as Derek mentions) what you're used to.

Regan
April 04, 2006
Re: not operator operator..
On Wed, 05 Apr 2006 01:23:03 +0300, Georg Wrede <georg.wrede@nospam.org>  
wrote:
> Anders F Björklund wrote:
>> S. Chancellor wrote:
>>
>>> I didn't say I wanted to program in AppleScript. :P  I hate mixing
>>> symbols and words.  This is terrible.  I'd rather redefine all the
>>> equal set and comparison operators.  The whole point of the  
>>> is-operator is equivalence, unfortunately there's no triple bar
>>> symbol.
>>  Sure there is. ≡ in Unicode (\u2261), or === in plain ASCII. It's
>> just that it was removed from the language in DMD 0.126 ?
>
> If D really _demands_ source code to be in UTF, then there is no excuse  
> for avoiding single-character operators like "≡".

Except that they're not easily acessable on a common/standard keyboard,  
right?

Regan
April 04, 2006
Re: not operator operator..
On Wed, 05 Apr 2006 10:31:04 +1200, Regan Heath wrote:

> On Wed, 05 Apr 2006 01:23:03 +0300, Georg Wrede <georg.wrede@nospam.org>  
> wrote:
>> Anders F Björklund wrote:
>>> S. Chancellor wrote:
>>>
>>>> I didn't say I wanted to program in AppleScript. :P  I hate mixing
>>>> symbols and words.  This is terrible.  I'd rather redefine all the
>>>> equal set and comparison operators.  The whole point of the  
>>>> is-operator is equivalence, unfortunately there's no triple bar
>>>> symbol.
>>>  Sure there is. ≡ in Unicode (\u2261), or === in plain ASCII. It's
>>> just that it was removed from the language in DMD 0.126 ?
>>
>> If D really _demands_ source code to be in UTF, then there is no excuse  
>> for avoiding single-character operators like "≡".
> 
> Except that they're not easily acessable on a common/standard keyboard,  
> right?

What? You mean you're *not* using the standard 473-key keyboard? How
strange !?


-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
5/04/2006 9:54:22 AM
April 05, 2006
Re: not operator operator..
Derek Parnell wrote:
> Regan Heath wrote:
>> Georg Wrede
>>> Anders F Björklund wrote:
>>>> S. Chancellor wrote:
>>>> 
>>>>> I didn't say I wanted to program in AppleScript. :P  I hate
>>>>> mixing symbols and words.  This is terrible.  I'd rather
>>>>> redefine all the equal set and comparison operators.  The
>>>>> whole point of the is-operator is equivalence, unfortunately
>>>>> there's no triple bar symbol.
>>>> 
>>>> Sure there is. ≡ in Unicode (\u2261), or === in plain ASCII.
>>>> It's just that it was removed from the language in DMD 0.126 ?
>>> 
>>> If D really _demands_ source code to be in UTF, then there is no
>>> excuse for avoiding single-character operators like "≡".
>> 
>> Except that they're not easily acessable on a common/standard
>> keyboard, right?
> 
> What? You mean you're *not* using the standard 473-key keyboard? How 
> strange !?

If somebody is able to produce "≡", then let him define it. All we need 
is some suitable syntax.

define ≡ opMyEqual;     // or something like this

I admit, this idea is not yet implementable as such: some operators may 
not be strictly binary, and other such issues. And I'm definitely not 
talking D 1.0 here. But still.

Such a character would of course only be used in that particular 
application, and thus probably be developed by a group of people who can 
tell each other how to produce this character. Or they can copy/paste it 
(just as I did, without even bothering to search for ways of actually 
typing it).

However, many very illustrative UTF characters do exist. Math, 
statistics, programming, logic, etc... could benefit from their use in 
source code.

And if they were user-defined-only (as opposed to ever becoming included 
in the actual D spec), issues of right or wrong usage should be on a par 
with issues around variable names. (I.e. any idiot can use variable 
names written in Thai or Russian characters, but it's still not too 
common, and never will be.)

---

I'm not really pursuing this issue as something First Priority, or 
Essential. It's more like, if we don't accept this, then what's the use 
of accepting any at all non-USASCII source code (outside of string 
literals)?
April 05, 2006
Re: not operator operator..
On Wed, 05 Apr 2006 03:37:40 +0300, Georg Wrede wrote:

> Derek Parnell wrote:
>> Regan Heath wrote:
>>> Georg Wrede

>>>> If D really _demands_ source code to be in UTF, then there is no
>>>> excuse for avoiding single-character operators like "≡".
>>> 
>>> Except that they're not easily acessable on a common/standard
>>> keyboard, right?
>> 
>> What? You mean you're *not* using the standard 473-key keyboard? How 
>> strange !?
> 
> If somebody is able to produce "≡", then let him define it. All we need 
> is some suitable syntax.

I'm sorry Georg, I wasn't disapproving of your idea, I was just making a
lame joke about needing a large keyboard to make such an idea easy-to-use.
In fact, I like the idea of being able to define new operators, but then I
love Forth too ;-)

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
5/04/2006 10:55:09 AM
April 05, 2006
Re: not operator operator..
Georg Wrede wrote:

>>>>> Sure there is. ≡ in Unicode (\u2261), or === in plain ASCII.
>>>>> It's just that it was removed from the language in DMD 0.126 ?
>>>>
>>>> If D really _demands_ source code to be in UTF, then there is no
>>>> excuse for avoiding single-character operators like "≡".
>>>
>>> Except that they're not easily acessable on a common/standard
>>> keyboard, right?
>>
>> What? You mean you're *not* using the standard 473-key keyboard? How 
>> strange !?
> 
> If somebody is able to produce "≡", then let him define it. All we need 
> is some suitable syntax.
> 
> define ≡ opMyEqual;     // or something like this
> 
> I admit, this idea is not yet implementable as such: some operators may 
> not be strictly binary, and other such issues. And I'm definitely not 
> talking D 1.0 here. But still.

An old feature request was that D should allow Unicode operators,
as an *alternative* to the ASCII operators. But it didn't catch on ?

http://www.prowiki.org/wiki4d/wiki.cgi?FeatureRequestList/UnicodeOperators
(Somehow these things are always treated as replacements, not add-ons)

> Such a character would of course only be used in that particular 
> application, and thus probably be developed by a group of people who can 
> tell each other how to produce this character. Or they can copy/paste it 
> (just as I did, without even bothering to search for ways of actually 
> typing it).

I just selected it from the Unicode input helper:
http://www.algonet.se/~afb/d/unicode-palette.png

> I'm not really pursuing this issue as something First Priority, or 
> Essential. It's more like, if we don't accept this, then what's the use 
> of accepting any at all non-USASCII source code (outside of string 
> literals)?

I believe that D in practice is an ASCII language. That's OK with me.

--anders
April 05, 2006
Re: not operator operator..
Georg Wrede wrote:

> Anders F Björklund wrote:
>> S. Chancellor wrote:
>> 
>>> I didn't say I wanted to program in AppleScript. :P  I hate mixing
>>> symbols and words.  This is terrible.  I'd rather redefine all the
>>> equal set and comparison operators.  The whole point of the
>>> is-operator is equivalence, unfortunately there's no triple bar
>>> symbol.
>> 
>> Sure there is. ≡ in Unicode (\u2261), or === in plain ASCII. It's
>> just that it was removed from the language in DMD 0.126 ?
> 
> If D really _demands_ source code to be in UTF, then there is no excuse
> for avoiding single-character operators like "≡".
> 

I have an utf-enabled email-client but that character is not present in my
standard font. I only see a nice rectangle :)
1 2 3 4 5
Top | Discussion index | About this forum | D home