Linked list with Prototype

Just starting out? Need help? Post your questions and find answers here.
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Linked list with Prototype

Post by Konne »

How can I call a List of Prototypes?
If there is any Logic it should work like that:

Code: Select all

Prototype Proc()

NewList Test.Proc()

Procedure Proce()
  ProcedureReturn 5
EndProcedure

AddElement(Test())
Test()=@Proce()

Debug Test()()   ;Compiler problem!
But it doesn't
Apart from that Mrs Lincoln, how was the show?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

hehe!
Good one :wink:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Prototypes can't be used with list or array, because it leads to wierd syntax (a compiler check has been added). If you need that, you can still create a structure and put the prototype in it, it's exactly the same code generated wise.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Test()()
... mhh... not so wierd :)
Simply it should mean a prototype used with list or array, IMHO
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It is wierd ;).
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Test(·)(·)
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Trond wrote:
Test(·)(·)
:lol:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Post by Konne »

It's not weird it's common sense. So it should work. I mean if you don't like it don't do it. Everything else would be a waste of resources and writing.
Apart from that Mrs Lincoln, how was the show?
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

It kinda looks weird yeah. I never really liked lists and arrays using () in the first place, looks too much like a procedure or function to me.

*wonders why Fred didn't use [] for lists and arrays instead*
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Rescator wrote:*wonders why Fred didn't use [] for lists and arrays instead*
BASIC :)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

Konne wrote:It's not weird it's common sense. So it should work.
:lol: that's a good joke
oh... and have a nice day.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

BASIC
Good point. But maybe Rescator has a point too about the [], unless you have other plans for them?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply