Hi Toninho, and all

to elaborate on this, it might be a good idea to introduce syntax for
nullable (nilable) types, just like in C#
it would suffice to assert a declaration with type info, followed by a
question mark

DATA bDraw AS CODEBLOCK? INIT nil

Then this var can be set to a CODEBLOCK or to NIL at any time; just fyi,
i've come to incorporate such syntax in my (o)ceans' project and it works
like a charm

This syntax can be extended to type assertions for arguments to
functions/methods where another nuance in meaning is that this argument is
optional; i've gone one step further in (o)ceans' to imply that all args
which are not nullable are by default 'required' arguments

The TYPE? syntax was taken from C#

my two cents,

frank

----- Original Message ----- From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
To: <harbour@harbour-project.org>
Sent: Tuesday, October 14, 2008 1:37 PM
Subject: [Harbour] Inconsistency in DATA Types


Hi folks,

I don´t know if this is an feature or a problem. If I have

DATA bDraw AS CODEBLOCK INIT nil

bDraw accept NIL without problem, but I can´t set it to nil again. If
I do:

oClass:bDraw = nil

I receive an error.

IMHO codeblock types can receive nil to easy checking, like:

if !( oClass:bDraw == nil )
  Eval( oClass:bDraw )
endif


Thanks and best regards,

Toninho.

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to