_ function

BlitzMax Forums/BlitzMax Programming/_ function

CS_TBL(Posted 2006) [#1]
I was just thinking, does anyone have/use a function with the name _ ?
Function _(v:int)
' blah
End Function

_ 1

_ 2

_ 3



..this is legal code :P I dunno what to think of it. Somehow I can see potentially smart use of it, but I wouldn't know what.. ^_^


Perturbatio(Posted 2006) [#2]
obfuscation of code is the only use I can see for it.

Function __:Int()
	Return 10
End Function
Function ___:Int()
	Return 100
End Function

Global _:Int

_ = __()+___()

Print _



H&K(Posted 2006) [#3]
I use it to deferentiate between internal fields and methods (privite) and external fields and methods (Public)

If BMax had real private/public then I would probably still use it, as it helps me keep track of which field/Methods I can access from the main program. (And when the list of member methods is aphabetical for a type, it holds them all in the same place)


Perturbatio(Posted 2006) [#4]
I prepend underscores for the same purpose, what he's talking about is the function being only an underscore.


H&K(Posted 2006) [#5]
Oh Silly me ;o