[Gambas-devel] About gb.gsl components

Benoît Minisini gambas at ...1...
Sun Jul 8 16:42:59 CEST 2012


Hi Randall,

I have no news from you for a long time. I hope everything is ok for you!

Since revision #4908, the interpreter allows any native class to handle 
the standard arithmetic operators - at least some of them at the moment: 
+, -, *, /, =, <>, and Abs(). This is done through the "_operators" 
interface.

Moreover, the "_convert" interface now allows to convert any native 
object to any other datatype, and is called by Str() and Print to 
convert an object to a localized string representation.

I used that in the Complex class, so that you can do:

	Dim A As New Complex(1, 4)
	Dim B As New Complex(3, -1)

	Print A;; B;; A * 2;; A * B;; A / B

	--> 1+4i 3-i 2+8i 7+11i -0,1+1,3i

I have ',' inside numbers because this the french decimal separator.

Tell me if you want to continue working on gb.gsl. That new feature 
could be implemented in polynomials, matrix... with automatic 
conversions between them maybe!

Regards,

-- 
Benoît Minisini





More information about the Devel mailing list