[Laszlo-dev] LZX type declarations [Was: For Review: Change 20081021-dda-p Summary: Add return type declarations to SWF9]
Donald Anderson
dda at ddanderson.com
Tue Oct 21 09:03:29 PDT 2008
Which do you like "return" or "returns"? I'll make this change and
fix the cast and retest.
I'd defer any other additions like naming return values:
returns="done:Boolean".
On Oct 21, 2008, at 11:53 AM, P T Withington wrote:
> On 2008-10-21, at 11:45EDT, André Bargull wrote:
>
>> Was it already decided how to declare return types in LZX? So, how
>> to name the attribute which specifies the type? It's now named
>> "type", any other proposals? Like "return" or "returns"?
>
> Yes: http://www.openlaszlo.org/pipermail/laszlo-dev/2008-February/013150.html
>
> This is an API addition, so does not need to be vetted like a
> change, but I think I prefer "return" or "returns" over "type". I
> would even propose that you should be able to name the return value
> (purely for documentation purposes), e.g.:
>
> <method name="update" args="when:Date" returns="done:Boolean>
>
>> Any cast needs to be: "foo cast Bar", "Bar(foo)" is only available
>> in plain AS3 code, in cross-runtime code the latter form is a
>> function call. (That's why DHTML broke for you.)
>>
>> We should consider to drop the lowercase "type"-declarations for
>> <attribute> and instead prefer the JavaScript alternatives, because
>> you need to use the Javascript-form anywhere else (typing for
>> function arguments, variables, function return types).
>
> I agree. Originally, we used lower-case in LZX because a) it looked
> pretty, and b) it is meant to match XML standards. But this means
> we have to map from the LZX/XML type to the appropriate Javascript
> type (and document separately the LZX and JS API's of every public
> class. It's made especially messy by JS's bi-cameral types (boolean/
> Boolean, etc.) We are probably stuck with the XML types for
> backwards compatibility, but we should encourage using JS types as
> we go forward.
>
>
--
Don Anderson
Java/C/C++, Berkeley DB, systems consultant
voice: 617-547-7881
email: dda at ddanderson.com
www: http://www.ddanderson.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20081021/6a87329b/attachment.html
More information about the Laszlo-dev
mailing list