[haXe] js

Franco Ponticelli franco.ponticelli at gmail.com
Sat Dec 1 00:54:38 CET 2007


I have to correct myself; the compiler should not complain about the use of
Null inside a function body since that is a perfectly valid and desirable.

Franco.

On Nov 30, 2007 10:22 PM, Axel Huizinga <axel at 3drachen.de> wrote:

> Franco Ponticelli schrieb:
>
> > "Null" (with starting uppercase) is a reserved word for nullable types
> > (maybe the compiler should complain about using it in the wrong
> > place). The keyword you need is "null" (lowercase).
> > Enum constructors (horizontal, vertical, arc) start by convention with
> > an uppercase letter ... it is not mandatory but good practice :-)
> >
> > On Nov 30, 2007 9:13 PM, Axel Huizinga <axel at 3drachen.de
> > <mailto:axel at 3drachen.de>> wrote:
> >
> >     Hi Franco,
> >
> >     > Can you send the code that has generated the error?
> >     > Anyway you don't need to import StdTypes because they are always
> >     > imported by default.
> >
> >     MenuBar.hx :
> >
> >     enum MAlign{
> >        TL;
> >        TC;
> >        TR;
> >        BL;
> >        BC;
> >        BR;
> >        LT;
> >        LC;
> >        LB;
> >        RT;
> >        RC;
> >        RB;
> >        F;
> >     }
> >     enum MOrient{
> >        horizontal;
> >        vertical;
> >        arc;
> >     }
> >
> >     typedef MenuStyle = {
> >        orient:MOrient,
> >        align:MAlign
> >     }
> >
> >     class MenuBar{
> >        public var style:MenuStyle ;
> >        public function new(?style:MenuStyle){
> >            this.style = if(style!=Null)style else {orient:horizontal,
> >     align:BC};
> >            trace(this);
> >        }
> >     }
> >
> >     instanciated from:
> >     import MenuBar;
> >
> >     class DynaMenuBar{
> >        public static function main(){
> >            new MenuBar({orient:horizontal, align:BC});
> >        }
> >     }
> >
> >
> >     ----
> >
> >     Axel
> >
> >
> >     --
> >     haXe - an open source web programming language
> >     http://haxe.org
> >
> >
> I love haxe :-)
>
> --
> haXe - an open source web programming language
> http://haxe.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20071201/3bd03ba6/attachment-0001.htm


More information about the Haxe mailing list