Forcing type for expression.
Posted: Wed Sep 23, 2009 1:26 pm
Procedure overloading: http://www.purebasic.fr/english/viewtop ... 47&start=8
Call(C)Function(Fast): http://www.purebasic.fr/english/viewtopic.php?t=37491
...2 very painful problems. 1 simple solution:
What was done here ? Well, we just made forced conversion of those expression, to ensure that result would have correct type. That's all ! No need to to restrict floats from Call(C)Function(Fast) anymore. No need to hestiate with adding some overload (which is very useful as replacement for OOP). Even more:
..That's, BTW, was a reason why I was forced to use ASM for core of my screensaver.
Q: Why you wan't just use own conversion procedures with desired type of return value.
A: I'm not that heartless. Forcing my CPU to create stack frame, push parameters, save return address, jump, pop parameters, release stack frame and finally return back... And what for ? To just do few bytes of ASM instruction ? Too cruel, I would definitely be bashed by 'Community of CPU-protectors' for such activities.
...So, what would you say ? Small and very useful addition, no ?
Call(C)Function(Fast): http://www.purebasic.fr/english/viewtopic.php?t=37491
...2 very painful problems. 1 simple solution:
Code: Select all
CallFunctionFast(*Ptr, {Val("123")}.l)
Procedure.L Over(P.l)
; ...proc code...
EndProcedure
Procedure.b Over(P.b)
; ...proc code...
EndProcedure
Define Test.q
Over({Test}.b)
Over({Test}.l)
Code: Select all
FractalRGB = {X ! Y}.A << 8
Q: Why you wan't just use own conversion procedures with desired type of return value.
A: I'm not that heartless. Forcing my CPU to create stack frame, push parameters, save return address, jump, pop parameters, release stack frame and finally return back... And what for ? To just do few bytes of ASM instruction ? Too cruel, I would definitely be bashed by 'Community of CPU-protectors' for such activities.
...So, what would you say ? Small and very useful addition, no ?