[Gambas-devel] Gambas Synthax suggestion

Benoit Minisini gambas at ...1...
Sun Nov 27 20:42:41 CET 2005


On Sunday 27 November 2005 15:50, Fabien Bodard wrote:
> 'proposition de syntaxe pour tableau d'objet
> Synthax proposition for spécific class object array...
>
> somtime i need to initialize a classe with an array of instance to another
> class like that :
>
> ' Gambas class file
> PUBLIC vertex AS NEW Object[]
>
> PUBLIC SUB _New()
>   DIM i AS Integer
>   DIM o AS CVertex
>   'Make an Array of three vertices
>   FOR i = 0 TO 2
>     o = NEW CVertex
>     vertex.Add(o)
>   NEXT
> END
>
> I there a way to have someting like :
>
> PUBLIC Vertex as New CVertex[3]
>

At the moment, this is impossible. It is not a syntax (compiler) problem, but 
an interpreter one.

I already tried to implement that this summer, but I failed. I will try again 
later for sure.

>
>
> 'proposition d'encapsulage des instanciation
> Syntaxe Proposition for new intance in add subs...
>
> like :
>   DIM o AS CVertex
>    o = NEW CVertex
>    vertex.Add(o)
>
> I think it can be set with :
>
> vertex.Add(NEW CVertex)

This could be possible now.

>
> 'proposition de déclaration de varable linéaires
> Linear Variable déclarations...
> Actually too long to do, mabe Not simple to synthetize...
>
> Is it possible to use a synthaxe like the c one ?
>
> ex:
> DIM x, y, z , u, v as Float
> DIM NumTriangle as Integer
>
> But the rule is one row by data type !

This is possible too.

Regards,

-- 
Benoit Minisini





More information about the Devel mailing list