[Gambas-devel] Ideas4Gambas
Fabián Flores Vadell
fabianfloresvadell at ...176...
Wed Jul 7 00:45:18 CEST 2010
>> PRIVATE $sFirstName, $sSurName AS String
>
> Implementing that syntax is possible, like for the DIM syntax.
>>
>> PRIVATE
>> $sFirstName, $sSurName AS String
>> $iAge, $iWeight AS Integer = {21, 75}
>>
>> CONST
>> ACONST, OTHER, ANOTHER AS Byte = {0,1,2}
>>
>>
>> I used "{}" because it's a common math symbol, used to define sets.
>>
>
> But I won't do that one: "{" & "}" are reserved for defining identifiers
> that
> the compiler must not interpret as keywords.
Ok, but it seems simple to me: the "{" can have two meanings depending
of the context. if the symbol "=" precedes the symbol "{" then defines
a set (like maths), but defines a identifier.
Also, you can add a "set" feature leaving to programmer define sets by
extensional definition ( A = {1,3,6,9, 14,17} ) and by intensional
definition:
A = {1..7} =~ {1,2,3,4,5,6,7} - abbreviated [1..7]
A = {2..6} =~ {2,3,4,5,6} - abbreviated (1..7)
A = {1..13, 2} =~ {1,3,5,7,9,11,13}
A = {'a'..'z'} =~ {'a', 'b', 'c', ... ,'x', 'y', 'z'}
A = {Z; x > -3; x < 5} =~ {-2,-1,0,1,2,3,4}
DIM A AS SET = {1,3,6,9, 14,17}
DIM B AS SET = {Z; x > -3; x < 5}
DIM C AS SET = {0..9}
PRINT A.Intersec(C)
? 1 3 6 9
Ok, maybe that's asking too much.
>> -----------
>>
>> IDEA: Gambas could make writing and running unit tests
>>
>> Building a framework to facilitate the construction, implementation
>> and evaluation of unit tests. Maybe by adapting some of existing test
>> frameworks.
>
> Can you give more details?
Like XUnit, JUnit, etc.
http://en.wikipedia.org/wiki/XUnit
http://es.wikipedia.org/wiki/JUnit
More information about the Devel
mailing list