Love PureBasic but hates that Procedures returns a value

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

Post by GPI »

Karbon wrote:Personally, I couldn't care less... :-)
Same here. It work. What do i want more?

btw: Procedures in Omikron Basic (Atari ST) can also return values, but under a "higher" level.
Example

Code: Select all

DefProc Test(R a, R b, c,d)
  a=a*c; 
  b=b*d
endproc
a=10:b=20
test(a,b,2,3)
;a is now 20
;b is 60
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

GPI wrote:btw: Procedures in Omikron Basic (Atari ST) can also return values, but under a "higher" level.
Ehhhh... NOW I'm worried... That is the side effect the lexicons talk about...

With returning a value I mean,

return value = Function X()

Not the variables in the parameter call... Even Fortran works that way... It depends if you use call by reference or call by value... This is the side effect...

GPI - You haven't really understand what I talk about if you make such a comment... Sorry! :roll:
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

techjunkie wrote:
GPI wrote:In PureBasic so many things are not-standard, for example Mid(): It should be Mid$().
*LOL*

Yeah! But you get a hint of what Mid() do, don't you... Lucky Fred didn't call Mid(), Bof() or even Burp(). Hehe... or to confuse really... switched Right() and Left().
He renamed InStr() in FindString() and change the order of the parameter ist...
freak
PureBasic Team
PureBasic Team
Posts: 5947
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Hey guys! We had this discussion before... several times in fact... We all
know where they led, and so wil this one: into nowhere.

So you can as well stop it, and live happy again :lol:

Timo
quidquid Latine dictum sit altum videtur
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

freak wrote:Hey guys! We had this discussion before... several times in fact... We all
know where they led, and so wil this one: into nowhere.

So you can as well stop it, and live happy again :lol:

Timo
I enjoy it... :D

A general discussion in a general discussion board. It don't have lead anywhere - it's fun to hear other peoples points of view...

But, well - enough discussion for now then... I had my dose for this week now... *LOL*
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

It's all good.... 1972 eh.. Wow :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Only one last comment about, Freak.

Techjunkie, i preferred Function instead Procedure too, but if i analise, it is because we are in custom with computer languages jargon (as said Karbon), but i prefer not to fall down in habits; moreover; i go much more back in time than computers appearance in our world:
Etymology of the word "Function" talks about something (or someone) which performs a work or a function, that's all. Nothing about to return anything, but perform a process.
Etymology of the word "Procedure" talks about process performing (in fact samething that Function), and neither talks about to return values.
There are no doubts that computer languages are always, more or less, a heritance of previous normal human language, so, really why Function instead Procedure?
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

Psychophanta wrote:... really why Function instead Procedure?
Coz it's faster for me to type!!!! :twisted: :twisted: :P

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
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post by Inner »

tech: "You can't teach old dogs, new tricks" I believe that's what your looking for.

you could go mad, and make pb a tokenised language, you know define your own command names. :p
MadMax
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Oct 06, 2003 11:56 am

Post by MadMax »

I seem to remember a time when you could use "alias" to change the name of any command. (maybe it was AMOS).

Thruth is that I prefer just one call it funtion or procedure, don't realy care. If you do you can always precede your procedure/funtion names with a F_xxxx or a P_xxxxx. I always prefer that it's the coder and not the language that imposes these kind of rules.
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

I think on Fred's ToDo list is a macro support for PureBasic. That could solve this Problem and many others, if it's implemented properly.
TronDoc
Enthusiast
Enthusiast
Posts: 310
Joined: Wed Apr 30, 2003 3:50 am
Location: 3DoorsDown

Post by TronDoc »

techjunkie wrote:If you don't think it is important, why not call the compiler an intepreter?
personally, I'd call it a translator which calls an assembler/linker...
...the two terms you used are not a good example for your argument because
they are function(pun intended)ally different :wink:
The first time I touched a computer (terminal) was 1974.
this is NOT a flame!
this is NOT a flame!
this is NOT a flame! :lol:
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
User avatar
geoff
Enthusiast
Enthusiast
Posts: 128
Joined: Sun Apr 27, 2003 12:01 am
Location: Cornwall UK
Contact:

Post by geoff »

Psychophanta wrote:Etymology of the word "Function" talks about something (or someone) which performs a work or a function, that's all. Nothing about to return anything, but perform a process.
Etymology of the word "Procedure" talks about process performing (in fact samething that Function), and neither talks about to return values.
There are no doubts that computer languages are always, more or less, a heritance of previous normal human language, so, really why Function instead Procedure?
I think the word "Function" was borrowed from mathematics when the first high level languages were created.

A maths function like sin(x) has a value so a subroutine (or function) to calculate this has something to return.

Unfortunately, "I did it my way" seems to be the first rule of compiler writers. There is little advantage in many of the differences between computer languages.
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

Inner wrote:you could go mad, and make pb a tokenised language, you know define your own command names. :p
Yeah - I have been thinking of that too... :D
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
horst
Enthusiast
Enthusiast
Posts: 197
Joined: Wed May 28, 2003 6:57 am
Location: Munich
Contact:

Post by horst »

techjunkie,

in my opinion this is a semantic issue.
The name of a function should be the name of the returned value.
For example "GadgetState(#gadget)" is a function, whereas
"GetGadgetState(#gadget)" is the name of a procedure (allthough
it is supposed to be a function).

But when you think about this for a while, you will find out that
the real problem of today's programming languages is the lack of
grammar based (verbal) expression handling.
Horst.
Post Reply