Page 1 of 1
Posted: Wed Feb 12, 2003 10:51 pm
by BackupUser
Restored from previous forum. Originally posted by Grasy.
...parameters like in this example:
Procedure something(param1.l,param2.l,maybe.b="0",standard.s="bla")
Posted: Wed Feb 12, 2003 11:12 pm
by BackupUser
Restored from previous forum. Originally posted by dmoc.
Don't think so.
Posted: Wed Feb 12, 2003 11:24 pm
by BackupUser
Restored from previous forum. Originally posted by Grasy.
But this would rock

...if you try to port and translate some functions without using a big knife.
Posted: Wed Feb 12, 2003 11:58 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.
while were on the subject of being lazy

what are your thoughts about this Python-like syntax for procedures:
Code: Select all
procedure printMe(**args)
for x=0 to len(args)
debug str(args(x))
next x
endprocedure
called like this:
Code: Select all
printMe("Hello", "I", "am", "Kale!")
produces:
Hello
I
am
Kale!
in the debug window.
or:
Code: Select all
procedure printMeKwargs(**kwargs)
ResetList(kwargs())
While NextElement(kwargs())
debug str(kwargs()\key)+" : "+str(kwargs()\value)
wend
endprocedure
called like this:
Code: Select all
printMeKwargs(apple.s="nice", banana.s="bent",)
produces:
apple : nice
banana : bent
in the debug window.
i may not have thought this through that carefully BTW
--Kale
Getting used to PureBasic and falling in Love! 
Posted: Thu Feb 13, 2003 12:03 am
by BackupUser
Restored from previous forum. Originally posted by Kale.
or what about multiple return values?
Code: Select all
procedure go()
a.s = "Hello"
b.s = "Again"
procedure return a, b
endprocedure
called like:
text = go()
debug text(0)
debug text(1)
produces:
Hello
Again
in the debug window
--Kale
Getting used to PureBasic and falling in Love! 