Modula in Version 3.8

Everything else that doesn't fall into one of the other PB categories.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Modula in Version 3.8

Post by GPI »

I heard, that in the next version a modula is included by the char %. I think, that this would be not the best char, because this is already used for dual-digits (%1010110).

Ok, the code should be always one possible of interpretation, but i think, that beginners could be confused. Also jaPBe will be confused...

GPI
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

Sorry for that, but the % char ist the perfect char for it.
That's because it's the standard char for Modulo in every other language that supports the modulo operator I know of.
Taking another char would confuse everybody with a little more programming knowledge and wouldn't help the beginners a lot too because they learn the wrong char and as soon as they try out another language they have to adopt to the %
Jedive
User
User
Posts: 36
Joined: Sun Jun 29, 2003 11:56 am
Location: Spain

Post by Jedive »

'Mod', like in Blitz, would be cool too, so we avoid confusion:

a=10 Mod 3

Would be the same as:

a=10 % 3
==Jedive==
MacBook Core Duo 2Ghz, 2GB, Intel GMA950, Leopard
Celeron M 1.5, 512MB, Intel 915GM, WinXP/DX9, Ubuntu
freak
PureBasic Team
PureBasic Team
Posts: 5946
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

> 'Mod', like in Blitz, would be cool too

In PB, all math and binary operators are represented by a single character.
Logical operators are represented as a word.

So it doesn't make sense to name it 'Mod' as it is no logical operator.

Saying it will confuse beginners is not the best excuse for being too lazy
for changing jaPEe :wink:

Timo
quidquid Latine dictum sit altum videtur
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

freak wrote:> 'Mod', like in Blitz, would be cool too

In PB, all math and binary operators are represented by a single character.
Logical operators are represented as a word.
I also know other languages (for example Omikron basic) and there are also *+/- but also MOD for modulo.

Saying it will confuse beginners is not the best excuse for being too lazy
for changing jaPEe :wink:
Two complete diffrent things.

Ok,it is not so easy to find out, what % then means (for jaPBe), because he has not a good "line check", because it is doesn't needed for now.

Also it is easier to read a source, when % don't have two meanings.

Of course, it is stupid to use a other char, but double meaning of % isn't a good idea. It is like the Constant is not Constant thing...
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

> In PB, all math and binary operators are represented by a single character.

One exception being Pow() which is usually denoted by ** or ^

But I agree % is more standard. I could (and do) live with Mod()
freak
PureBasic Team
PureBasic Team
Posts: 5946
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

> One exception being Pow() which is usually denoted by ** or ^

Yeah, i miss than one, too. Especially since Pow() is for floats, and it would
be cool to have an integer one.

Timo
quidquid Latine dictum sit altum videtur
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

We manage OK with the dual use of -.

% is exactly the same, since there is a distinct unary and binary meaning.
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

And the dual use of the * not to forget
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

GPI: What is exactly the problem with JaPBe ? The introduction of this operand shouldn't break any code as the binary numbers will be still correctly interpreted:

Code: Select all


  a = 10 + %10101 ; Still working properly
  a = 10 % %11     ; Works ok too.

As FreeDimension said, the pointer thing is the same (a = a* *b)
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post by Inner »

GPI: Just use UltraEdit :)
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

Just wondering.. what if we omit the spaces?!?
say if we did something like this: a = 10%10 ?

-Lars

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
freak
PureBasic Team
PureBasic Team
Posts: 5946
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

a = 10%10
Is interpreted as 10 mod 10, because if the % would mean binary here,
then there would be another operator missing between 10 and %10.

Timo
quidquid Latine dictum sit altum videtur
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

freak wrote:a = 10%10
Is interpreted as 10 mod 10, because if the % would mean binary here,
then there would be another operator missing between 10 and %10.

Timo
Yes, i know it, but for japbe, %10 is here a binary. That is the big diffrent to *name and mul. I don't think, that somehing like *adr2= 2**Adr1 is ever written, because it makes no thense.

A=b%%10 looks little bit stupid.

also japbe looks word for word and all chars are seperators.
freak
PureBasic Team
PureBasic Team
Posts: 5946
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

jaPBe is your problem ...

An Editor should be designed to work with the compiler, not the other way around.

Timo
quidquid Latine dictum sit altum videtur
Post Reply