LIST parameter without type

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
horst
Enthusiast
Enthusiast
Posts: 197
Joined: Wed May 28, 2003 6:57 am
Location: Munich
Contact:

LIST parameter without type

Post by horst »

The list paramter requires the (data) type, for example

Code: Select all

Procedure ListOperation(List Dummy.type(), parm2, parm3) 
However, a programmer might want to write a procedure where the data part (and the structure, type) are not used at all (only functions like NextElement(), SwapElement() etc.). Therefor it should be possible to omit the type in the procedure definition.

This would be very usefull for a sort procedure (that uses a callback for data comparison), or for a function to move a sequence of list elements.

The compiler could still produce an error, when an attempt is made to use the element's data.
Horst.