Re: Unicode function name? ∩

2016-09-07 Thread Illuminati via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 07:39:53 UTC, Jesper Tholstrup 
wrote:

On Tuesday, 6 September 2016 at 20:26:01 UTC, Illuminati wrote:

Ok, continue your game I see you are quite involved with 
it.


For what it's worth I was actually trying to learn something. I 
apologize if I contributed to sidetracking the discussion.


Well, I tried to tell you that you are hung up on the meaning of 
meaningless things and you said that it was all my personal 
opinion. Either it is or isn't but simply stating it proves 
nothing. It's up for you to decide if what I have said is worth 
pursuing for yourself or not.


But surely you would agree that if you believe something has 
inherent meaning but it actually doesn't that you are creating a 
whole world of grief for yourself and others? Hence, it is utmost 
importance to know?


All I will say is "Don't confuse the map with the territory". The 
territory exists without the map, but not vice versa.






Re: Unicode function name? ∩

2016-09-07 Thread Jesper Tholstrup via Digitalmars-d-learn

On Tuesday, 6 September 2016 at 20:26:01 UTC, Illuminati wrote:


Ok, continue your game I see you are quite involved with it.


For what it's worth I was actually trying to learn something. I 
apologize if I contributed to sidetracking the discussion.




Re: Unicode function name? ∩

2016-09-06 Thread Illuminati via Digitalmars-d-learn
On Tuesday, 6 September 2016 at 19:58:11 UTC, Jesper Tholstrup 
wrote:

On Tuesday, 6 September 2016 at 18:46:52 UTC, Illuminati wrote:

[...]


You are somewhat of topic here.


[...]


A lot of code is written by non-mathematicians and has to be 
maintained by non-mathematicians. Mathematicians will be 
confused when people start using the symbols incorrectly, 
simply because they try to be clever. Sure, some developers 
would probably mix up english words like 'intersect' and 
'union', but I think that it is less common.


[...]


Ok, continue your game I see you are quite involved with it.


Re: Unicode function name? ∩

2016-09-06 Thread Jesper Tholstrup via Digitalmars-d-learn

On Tuesday, 6 September 2016 at 18:46:52 UTC, Illuminati wrote:


Symbols are inherently meaningless so you are not making sense. 
Clever is what got humans out the jungle, I think it is a good 
thing. No need to denigrate it when you benefit from people 
being clever. Of course, you could argue that staying in the 
jungle would have been the best thing...


You are somewhat of topic here.


Mathematicians don't seem to get confused by symbols.


A lot of code is written by non-mathematicians and has to be 
maintained by non-mathematicians. Mathematicians will be confused 
when people start using the symbols incorrectly, simply because 
they try to be clever. Sure, some developers would probably mix 
up english words like 'intersect' and 'union', but I think that 
it is less common.


You have simply memorized what those groups of symbols mean and 
you are too lazy to memorize what some other symbol means.


Personal... and wrong...

Once you realize the game you are playing with yourself then it 
becomes easier to break the bad habit and not get caught up in 
the nonsense.


Personal... and wrong... My argument goes towards code 
maintainability and it is still valid.




The reason why ∩ is better than intersect is because it is 
quicker to see and analyze(due to its "size"). True, it is more 
ambiguous, as ambiguity depends on size, but at least in this 
case it has been well established just as π and 1,2,3..., etc. 
But if you are so concerned about ambiguity then why not 
intersectsetofarithmeticintegerswithsetofarithmeticintegers? 
That is far less ambiguous than intersect.


As long as humans write software I think (personal estimate) that 
few would call 
'intersectsetofarithmeticintegerswithsetofarithmeticintegers' a 
readable symbol. I suppose that our invention of snake case, 
camel case, pascal case, ect. lends some support to my claim.




My point is, you are playing games. You might not realize it 
but that is what is going on. If you want to be truthful, it is 
better to say "I prefer to use my own personal standardized 
notation that I have already learned since it takes precious 
time away from my own life.".


Personal, again. No real content.

You do realize that 'my own personal standardized notation' 
encompass >99% of all software thus far - right?


Your argument is exactly analogous to "I don't speak french! 
Use English you stupid french speaking person, french is for 
idiots anyways".


I'm not a native English speaker, so I'm not sure that your 
argument is valid here. I have learned different languages and 
various diciplines of natural science. I still don't think that 
methods/functions should contain e.g. math symbols.


The tone is irrelevant, the point is acting like one 
superficial system is better than some other superficial system 
simply because of perspective/laziness/arrogance/etc. The only 
issues are that either you are failing to see the systems as 
superficial or you are failing to see that your own personal 
center of the universe is not actually the center of the 
universe.


Personal, again... and it could easily be the other way around I 
think.


So just be real. The reason you don't like it is because it 
confuses you.


Personal, again... and not really

If it didn't, you wouldn't have a problem with it. If you could 
speak French and English then you, if you were that 
hypothetical person, wouldn't care what language was used.


So far of the topic.

 All I can say is that everyone is confused until they learn 
something. But don't confuse your confusion with some innate 
scale of better/worse, it only leads to more confusion. The 
solution to all confusion is familiarity. Become familiar with 
your confusion(e.g., using ∩) and it won't be confusing anymore.


Personal, again. I'm not really confused (I think).



The reason the mathematical symbols don't phase me is because I 
spent years using them. In my mind ∩ = intersection of 
sets(which I have a non-verbal meaning in my own mind on what 
that means). I see no difference between ∩ and intersect. Hence 
I am not confused.


Cool, the *years* of usage really payed off...

If someone comes along and uses ∩ to mean what I call union. 
Then it won't confuse me either. Because I realize they have 
just relabeled stuff.


Okay, thats quite a statement... I would argue that many 
developers, not you of course, could oversee the incorrect symbol.


Sure I have to keep track, but as long as they are 
logical(consistent) then I'll get used to(familiar) with their 
system and it won't be a problem.


Okay.

I won't get angry or upset that they are trying to pull the rug 
out from underneath me. I'll realize that they just speak 
French and if I want to communicate with them I'll learn 
French. No big deal, I'll be more enlightened from doing so. 
Sure it takes some time, but what else do we humans have to do? 
Everything we do just superficial anyways.


Eh, okay...

You will win in terms of their usage, 

Re: Unicode function name? ∩

2016-09-06 Thread Illuminati via Digitalmars-d-learn
On Tuesday, 6 September 2016 at 13:41:22 UTC, Jesper Tholstrup 
wrote:

On Tuesday, 6 September 2016 at 02:22:50 UTC, Illuminati wrote:

It's concise and has a very specific meaning.


Well, only if we can agree on what the symbols mean. I'm not 
sure that every symbol is concise and specific across the 
fields of mathematics, statistics, and physics.


The worst part, however, is our (humans, that is) intrinsic 
desire to be "clever". There will be an endless incorrect use 
of symbols, which will render code very difficult to understand 
Friday afternoon when things break.


Symbols are inherently meaningless so you are not making sense. 
Clever is what got humans out the jungle, I think it is a good 
thing. No need to denigrate it when you benefit from people being 
clever. Of course, you could argue that staying in the jungle 
would have been the best thing...


The whole point of symbols is to simplify, ∩ is more simple 
than intersect as the first requires 1 symbol and the second 
requires 8 symbols.


I don't buy that argument - fewer symbols is better? If so 
disagree, its a lot easier to make and a lot harder to catch a 
∩ vs ∪ error compared to 'intersect()' vs 'union()' error.



How is Unicode normalization handled? It is my impression that 
certain symbols can be represented in more than one way. I 
could be wrong...


Mathematicians don't seem to get confused by symbols. intersect 
is a symbol. It is no different than ∩ or any other symbol. It is 
just chicken scratch. There is no inherent meaning in the wavy 
lines. If you think there is then you are deluding yourself. You 
have simply memorized what those groups of symbols mean and you 
are too lazy to memorize what some other symbol means. Once you 
realize the game you are playing with yourself then it becomes 
easier to break the bad habit and not get caught up in the 
nonsense.


The reason why ∩ is better than intersect is because it is 
quicker to see and analyze(due to its "size"). True, it is more 
ambiguous, as ambiguity depends on size, but at least in this 
case it has been well established just as π and 1,2,3..., etc. 
But if you are so concerned about ambiguity then why not 
intersectsetofarithmeticintegerswithsetofarithmeticintegers? That 
is far less ambiguous than intersect.


My point is, you are playing games. You might not realize it but 
that is what is going on. If you want to be truthful, it is 
better to say "I prefer to use my own personal standardized 
notation that I have already learned since it takes precious time 
away from my own life.". When do you this, I cannot argue with 
you, but then you also have to accept that you cannot argue with 
me(or anyone else). Because what makes sense or works for you 
might not work for me or someone else.


Your argument is exactly analogous to "I don't speak french! Use 
English you stupid french speaking person, french is for idiots 
anyways". The tone is irrelevant, the point is acting like one 
superficial system is better than some other superficial system 
simply because of perspective/laziness/arrogance/etc. The only 
issues are that either you are failing to see the systems as 
superficial or you are failing to see that your own personal 
center of the universe is not actually the center of the universe.


So just be real. The reason you don't like it is because it 
confuses you. If it didn't, you wouldn't have a problem with it. 
If you could speak French and English then you, if you were that 
hypothetical person, wouldn't care what language was used.  All I 
can say is that everyone is confused until they learn something. 
But don't confuse your confusion with some innate scale of 
better/worse, it only leads to more confusion. The solution to 
all confusion is familiarity. Become familiar with your 
confusion(e.g., using ∩) and it won't be confusing anymore.


The reason the mathematical symbols don't phase me is because I 
spent years using them. In my mind ∩ = intersection of sets(which 
I have a non-verbal meaning in my own mind on what that means). I 
see no difference between ∩ and intersect. Hence I am not 
confused. If someone comes along and uses ∩ to mean what I call 
union. Then it won't confuse me either. Because I realize they 
have just relabeled stuff. Sure I have to keep track, but as long 
as they are logical(consistent) then I'll get used to(familiar) 
with their system and it won't be a problem. I won't get angry or 
upset that they are trying to pull the rug out from underneath 
me. I'll realize that they just speak French and if I want to 
communicate with them I'll learn French. No big deal, I'll be 
more enlightened from doing so. Sure it takes some time, but what 
else do we humans have to do? Everything we do just superficial 
anyways.













Re: Unicode function name? ∩

2016-09-06 Thread Jesper Tholstrup via Digitalmars-d-learn

On Tuesday, 6 September 2016 at 02:22:50 UTC, Illuminati wrote:

It's concise and has a very specific meaning.


Well, only if we can agree on what the symbols mean. I'm not sure 
that every symbol is concise and specific across the fields of 
mathematics, statistics, and physics.


The worst part, however, is our (humans, that is) intrinsic 
desire to be "clever". There will be an endless incorrect use of 
symbols, which will render code very difficult to understand 
Friday afternoon when things break.


The whole point of symbols is to simplify, ∩ is more simple 
than intersect as the first requires 1 symbol and the second 
requires 8 symbols.


I don't buy that argument - fewer symbols is better? If so 
disagree, its a lot easier to make and a lot harder to catch a ∩ 
vs ∪ error compared to 'intersect()' vs 'union()' error.



How is Unicode normalization handled? It is my impression that 
certain symbols can be represented in more than one way. I could 
be wrong...




Re: Unicode function name? ∩

2016-09-05 Thread Illuminati via Digitalmars-d-learn

On Monday, 29 August 2016 at 12:53:26 UTC, Jesper Tholstrup wrote:

On Sunday, 28 August 2016 at 05:21:03 UTC, Tofu Ninja wrote:

Are unicode function names not supported in dmd?
bool ∩(A, B)(A a, B b){
return intersect(a, b);
}
Error: character 0x2229 is not a valid token



Personally, I would prefer 'intersect' as a function name over 
'∩' anytime.


Which benifits does the symbols add?


It's concise and has a very specific meaning. If one is working 
with mathematical objects and set up correctly then it can be 
more easily interpreted because it is `inline` with standard 
mathematical syntax.


It's the same reason mathematicians prefer ∩ over intersect. You 
would prefer it too if you got used to it. The whole point of 
symbols is to simplify, ∩ is more simple than intersect as the 
first requires 1 symbol and the second requires 8 symbols.





Re: Unicode function name? ∩

2016-08-29 Thread Jesper Tholstrup via Digitalmars-d-learn

On Monday, 29 August 2016 at 13:06:17 UTC, Cauterite wrote:


Sounds like you'd love Java.
x = new BigDecimal("0.1")
x.negate().divide(y).compareTo(z)

who needs symbols? >_>


Well, I wasn't trying to start a language battle, I like D (which 
maintains a 'union' keyword;-))


I simply see no need for code obfuscation using, possibly, 
ambiguous symbols.


Your auto 'start-pointing-fingers' reply did not change that.








Re: Unicode function name? ∩

2016-08-29 Thread Cauterite via Digitalmars-d-learn

On Monday, 29 August 2016 at 12:53:26 UTC, Jesper Tholstrup wrote:
Personally, I would prefer 'intersect' as a function name over 
'∩' anytime.


Which benifits does the symbols add?


Sounds like you'd love Java.
x = new BigDecimal("0.1")
x.negate().divide(y).compareTo(z)

who needs symbols? >_>


Re: Unicode function name? ∩

2016-08-29 Thread Jesper Tholstrup via Digitalmars-d-learn

On Sunday, 28 August 2016 at 05:21:03 UTC, Tofu Ninja wrote:

Are unicode function names not supported in dmd?
bool ∩(A, B)(A a, B b){
return intersect(a, b);
}
Error: character 0x2229 is not a valid token



Personally, I would prefer 'intersect' as a function name over 
'∩' anytime.


Which benifits does the symbols add?





Re: Unicode function name? ∩

2016-08-28 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2016-08-28 at 08:03 +, Cauterite via Digitalmars-d-learn
wrote:
> On Sunday, 28 August 2016 at 05:21:03 UTC, Tofu Ninja wrote:
> > 
> > Are unicode function names not supported in dmd?
> 
> Here's a few ANSI characters you can use (and can type with 
> alt-codes):
> ª º · Ø ø µ ƒ
> I use º pretty often, it makes a nice sigil.

And if you can't remember the alt-codes (I never can) I use compose
keys for the easy stuff ™ © ° and the like and keyboard remapping for
the harder stuff θ μ π and the like..

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

signature.asc
Description: This is a digitally signed message part


Re: Unicode function name? ∩

2016-08-28 Thread Cauterite via Digitalmars-d-learn

On Sunday, 28 August 2016 at 05:21:03 UTC, Tofu Ninja wrote:

Are unicode function names not supported in dmd?


Here's a few ANSI characters you can use (and can type with 
alt-codes):

ª º · Ø ø µ ƒ
I use º pretty often, it makes a nice sigil.


Re: Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn

On Sunday, 28 August 2016 at 05:28:17 UTC, rikki cattermole wrote:

On 28/08/2016 5:21 PM, Tofu Ninja wrote:

...


Try Ÿ.


Yeah Ÿ and π both work but ∩ does not. I think I found my answer 
though...

http://dlang.org/spec/lex.html#IdentifierChar
Identifiers start with a letter, _, or universal alpha, and are 
followed by any number of letters, _, digits, or universal 
alphas. Universal alphas are as defined in ISO/IEC 9899:1999(E) 
Appendix D. (This is the C99 Standard.) Identifiers can be 
arbitrarily long, and are case sensitive. Identifiers starting 
with __ (two underscores) are reserved.


Re: Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn

On Sunday, 28 August 2016 at 05:21:03 UTC, Tofu Ninja wrote:

...
Also visual D seems to recognize its not a valid character and 
highlights the error which makes me think its known behavior.


Re: Unicode function name? ∩

2016-08-27 Thread rikki cattermole via Digitalmars-d-learn

On 28/08/2016 5:21 PM, Tofu Ninja wrote:

Are unicode function names not supported in dmd?
bool ∩(A, B)(A a, B b){
return intersect(a, b);
}
Error: character 0x2229 is not a valid token

I won't be terribly disappointed if I can't do this, I really just tried
it on a whim, but I thought dmd supported unicode.


Try Ÿ.
The character I have shown above will work as it is an alphabetic[0] 
character.


[0] http://dlang.org/phobos/std_uni.html#.isAlpha


Re: Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn

On Sunday, 28 August 2016 at 05:21:03 UTC, Tofu Ninja wrote:

Are unicode function names not supported in dmd?
bool ∩(A, B)(A a, B b){
return intersect(a, b);
}
Error: character 0x2229 is not a valid token

I won't be terribly disappointed if I can't do this, I really 
just tried it on a whim, but I thought dmd supported unicode.


Oddly enough bool π(A, B)(A a, B b) { ... } works just fine.


Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn

Are unicode function names not supported in dmd?
bool ∩(A, B)(A a, B b){
return intersect(a, b);
}
Error: character 0x2229 is not a valid token

I won't be terribly disappointed if I can't do this, I really 
just tried it on a whim, but I thought dmd supported unicode.