Author Topic: =>  (Read 2563 times)

Offline Markus

  • Mr. Polyvector
  • ***
  • Posts: 125
  • Offline
    • View Profile
=>
« on: 2012-Apr-22 »
=> ist Syntyx error und man muß >= schreiben.
Das läßt sich doch bestimmt einfach erweitern.

Wenn ich z.B. gucken möchte ob die Mauspos. in einem Rechteck ist schreibe ich immer mx=>x1
weil = der Rand ist und es dann nach innen mit > weiter geht.
Auf der rechten Seite schreibe ich mx<=x2
Die XY Koordinaten gehen ja auch von links nach rechts und oben nach unten.

Offline hardyx

  • Community Developer
  • Dr. Type
  • ******
  • Posts: 487
    • View Profile
Re: =>
« Reply #1 on: 2012-Apr-22 »
In *all* programmig languages the comparation operators used are: <=, = and >=, the equal sign is always in the right. The forms => or =< are not valid. Using a=>b is odd. It's easy to put it in the correct form: b<=a.

Offline Markus

  • Mr. Polyvector
  • ***
  • Posts: 125
  • Offline
    • View Profile
Re: =>
« Reply #2 on: 2012-Apr-22 »
i think not all but.
glbasic can translate it also before compiling the c source.

= and > is two in one , a human need no order , its equal or greater , greater or equal.

Visual Basic 2010 and VisualBasic 6 replace the two chars on the fly in the editor.
BlitzBasic3D understand =>
BlitzMax understand =>
DarkBasic Pro understand =>

you can see in 5 of 5 i can write it and its a entrenched habit :-)

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Re: =>
« Reply #3 on: 2012-Apr-22 »
We say "greater than or equal to" and we also say "less than or equal to". We don't tend to say it the other way around. So for me it makes sense.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Offline Markus

  • Mr. Polyvector
  • ***
  • Posts: 125
  • Offline
    • View Profile
Re: =>
« Reply #4 on: 2012-Apr-22 »
the x coord move from left to right so the equal comes first then the greater.
i transfer what i see in a program.
for me is this => inside <=
it looks like two arrows , you can better read and understand this as >= <=


Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4128
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: =>
« Reply #5 on: 2012-Apr-22 »
I used to use Div Games Studio and that accepted => or >=  and <= or =<

Like you Markus, I always used => and <= too, as they looked like arrows and somehow appeared neater/tidier in the code. Strange but true.

Even after using GLB for a couple of years, I still get the order wrong sometimes for comparisons like this.
I came. I saw. I played.

Offline Gary

  • Dr. Type
  • ****
  • Posts: 313
    • View Profile
Re: =>
« Reply #6 on: 2012-Apr-22 »
While on this subject I keep typing != as I am used to writing in C, If the alternatives get added could this be added as well?

Offline Markus

  • Mr. Polyvector
  • ***
  • Posts: 125
  • Offline
    • View Profile
Re: =>
« Reply #7 on: 2012-Apr-23 »
i found a new example why i write this  :S

IF LEN(self.text$)=>1 THEN ...

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1751
    • View Profile
    • Homepage
Re: =>
« Reply #8 on: 2012-Apr-23 »
Since I do more PHP than anything else at the moment, I would be so confused. => is used for totally different things, see snip below:

Code: GLBasic [Select]
$var = array(
    'first' => 1,
    'second' => 2,
    'third' => 3,
);

When I started programming there was languages that accepted them in any order and that just made me confused. If I would have been forced to the correct order directly mabe it would have been easier now.

Offline Markus

  • Mr. Polyvector
  • ***
  • Posts: 125
  • Offline
    • View Profile
Re: =>
« Reply #9 on: 2012-Apr-23 »
@Moru
PHP is gay :-)
can be much easier
the $ must confuse you also ;-)