New short-circuit AND/OR operators in FB

General discussion for topics related to the FreeBASIC project or its community.
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA

Post by DaveUnit »

What's wrong with && and ||?
Nice and quick to type.
I suppose it's not very BASIC, but it looks much nicer in my opinion. And I guess you'd hafta change and/or to &/| to keep with the current look. Maybe if the operators could be represented in 2 ways?
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

DaveUnit, what are you trying to get us killed by the fanatics..?
mambazo
Posts: 652
Joined: Jul 17, 2005 13:02
Location: Ireland
Contact:

Post by mambazo »

@cha0s: lol


@all: How about a convention similar to if and iif.

Maybe AndS and OrS. S for short-circuit.
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA

Post by DaveUnit »

My bad, cha0s. :X
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

Hey I like ands and ors, it looks good even when you don't capitalize.
krcko
Posts: 163
Joined: Jul 30, 2006 0:34
Location: Serbia
Contact:

Post by krcko »

i just don't see what's wrong with AndAlso and OrElse? i mean, microsoft decided to use those, why we should same thing name differently?
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Post by duke4e »

new "and" and "or" need to be as short as possible.
i whould even be happy with "and2" and "or2"
Last edited by duke4e on May 23, 2008 16:33, edited 1 time in total.
wolfstar
Posts: 96
Joined: Nov 07, 2006 12:42

Post by wolfstar »

I like AndAlso and OrElse, 'cause it won't take long for people to put them somewhere other than in an IF statement. Or deleters idea's the best i think.
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Post by counting_pine »

Personally, I think they look OK outside of If statements.
But I think Hexadecimal Dude has a point - they do look too much like part of the If..ElseIf..EndIf structure.
I think that was probably a significant consideration in the minds of Microsoft when they named those operators in the first place.
Eclipzer
Posts: 432
Joined: Oct 01, 2005 10:50
Location: Maryland
Contact:

Post by Eclipzer »

Okay, so understanding that these are short-circuit and/or I think ands/ors would be a better choice, since really they're just an extension to standard and/or. But, why not have some fun and name them sand/sor? =)
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA

Post by DaveUnit »

I like sand/sor!
calstover
Posts: 68
Joined: Aug 21, 2006 16:51

my vote

Post by calstover »

Another vote for sand and sor

and a vote against && and ||. Don't make me use the shift key when I'm trying to think ;-)
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Post by anonymous1337 »

krcko wrote:i just don't see what's wrong with AndAlso and OrElse? i mean, microsoft decided to use those, why we should same thing name differently?
Microsoft decided to charge for their products. We might as well do the same! In that case... I have an announcement to make. I will now start contributing to the compiler source :D
But I think Hexadecimal Dude has a point - they do look too much like part of the If..ElseIf..EndIf structure.
Isn't that pretty much what they end up being in the end? They are short-circuited, or whatever.
Another vote for sand and sor
Sand Sor! Him and Gland Glor are going to take over the world :D
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

You need not to define NEW FB only names LAND and LOR are often used for this.

http://www.google.de/search?&q=logic+op ... ND+and+LOR

Joshy
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Post by anonymous1337 »

Then Land Lor and Gland Gor will take over the world together :D
Post Reply