[V4REV] Constants. Plan 2.

ron barber rbarber at yhb.att.ne.jp
Mon Jun 20 17:33:37 CDT 2005


Hi Ruslan,

first, my bad on the previous post about  Mode parameter. As you  
pointed out, I had it in the wrong place. Sorry for the confusion and 
thanks for your help.

On Jun 20, 2005, at 4:28 PM, Ruslan Zasukhin wrote:
> * Revolution do not have enums. And it do not have constants.
>
> * It is bad idea that external born many global constants or even 
> single
> global array with constants.
>
> * Revolution is string - oriented language. So we will define 
> constants as
> strings.

Agreed

> ----------------------------
> * All our docs examples and examples stacks will be corrected to 
> always use
> double quotes around string constants.

Please and thank you. This is really important for new users of Val.

> This is short notation of constant
>
>     VDatabase_Create( dbRef, path, "kDsc_Dat_Blb_Ind", 32 * 1024 )
>
>
> This is verbose notation of constant
>
>     VDatabase_Create( dbRef, path, "EVMode.kDsc_Dat_Blb_Ind", 32 * 
> 1024 )

As long as we have both options I think this is very consistent with 
what xtalkers expect.

> Ak....may be just forget about ENUM names ....
> Just future it is always simpler if you and we will tell:
>     I use constant of EVDbMode
>
> I.e. We will have some kind of terminology.
> ----------------------------
> *** Again, now our docs and examples sometimes skip double quotes.
>     we have to think this is bad idea, because AT LEAST one place
>     require quotes always: when you will specify field flags.
>
>          Create_VarChar( name, 1022, "fIndexed + fIndexByWords" )
>
> Note can be use  + COMA SPACE  as delimiters.

Create_VarChar( name, 1022, "fIndexed fIndexByWords" )
Create_VarChar( name, 1022, "fIndexed, fIndexByWords" )
Create_VarChar( name, 1022, "fIndexed + fIndexByWords" )
are the same right?

Again, this is good to have options that are standard in xtalk. These 
three options, plus comma space, are good. It should be stated early in 
the docs that these three are interchangeable and then use one 
consistently in the docs.

> So we have decide that AT LEAST our docs and exmaples should be 
> consistent,
> and always to use double quotes.

yes

> -----------------------------
> * About support of numeric values for ENUM types.
>
> I think it is good idea DO NOT allow this. Because numeric constant is 
> NOT
> readable for developer. We have a lots of constants, and I think 
> nobody can
> memories them.

you are right, as the first of the letter shows, I can't even keep the 
order straight  ; )

okay, passing numbers as parameters is a common practice in my 
experience, even if it is bad practice. The question is, do you want to 
allow it in v4rev? I personally can live without it. I think the docs 
should not show numerical equivalents if you decide not to allow 
numbers.

For example:
get VDatabase_Create(dbRef, mPath,"EVDbMode.kDscDatBlbInd", 32 * 1024) 
- ok
get VDatabase_Create(dbRef, mPath,"kDscDatBlbInd", 32 * 1024) - ok
get VDatabase_Create(dbRef, mPath,1, 32 * 1024) - na - not allowed

sometimes I have seen xcmds use this form:
get VDatabase_Create(dbRef, mPath,"1", 32 * 1024)

what do you think of this?

Thanks again for your hard work on our behalf,
Ron




More information about the Valentina-beta mailing list