flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Wasilewski <devudes...@gmail.com>
Subject Re: [FalconJS] concepts
Date Wed, 28 Nov 2012 22:19:39 GMT
I can spare my free time on this, Possibly not on Apache contributor 
level because I am total noob when comes to it. I don't even managed to 
set up my environment for flexSDK ;) But this is because I've got AIR 
corrupted and some windows x86 redistributable corupted libs blabla, the 
only reasonable solution is to go for fresh Windows installation. Hell 
no...!! ;)

I am not JS guru, but would like to get involved and do my best even as 
I was digging into JS for past year just to investigate the 
possibilities. Mostly from performance point of view and mobile development.

In regards to instanceof:

Here is something that haxe is using

js.Boot.__instanceof = function(o,cl) {
     try {
         if(o instanceof cl) {
             if(cl == Array) return o.__enum__ == null;
             return true;
         if(js.Boot.__interfLoop(o.__class__,cl)) return true;
     } catch( e ) {
         if(cl == null) return false;
     switch(cl) {
     case Int:
         return Math.ceil(o%2147483648.0) === o;
     case Float:
         return typeof(o) == "number";
     case Bool:
         return o === true || o === false;
     case String:
         return typeof(o) == "string";
     case Dynamic:
         return true;
         if(o == null) return false;
         if(cl == Class && o.__name__ != null) return true; else null;
         if(cl == Enum && o.__ename__ != null) return true; else null;
         return o.__enum__ == cl;

having something like that implemented

'is' is as easy as:

Std["is"] = function(v,t) {
     return js.Boot.__instanceof(v,t);

But obviously, it needs to live within rest of the sugar :).

Are you able to provide the list of stuff/fields that compiler is 
expecting to meet on the other side?


On 11/28/2012 9:42 PM, Alex Harui wrote:
> On 11/28/12 1:35 PM, "Daniel Wasilewski" <devudesign@gmail.com> wrote:
>> So, please tell me why not to go the classic route as a very little overhaul
>> for the application that can be built on top of AS3/Flex?
>> This is bloody 3 classes with 4 methods in it, and we are not talking here
>> about few % but tens.
>> It can only grow exponentially to the scale of your project.
> I don't know enough to have an reason not to go the classic route.  But
> someone else will have to step up to do the work.
> That said, because we are cross compiling AS, does the classic route support
> as many features of AS, especially the reflection-oriented features?  We
> want to try to compile business logic untouched and it might be using "is",
> "in", "instanceof", etc.  Resig's blog seems to indicate that support for
> instanceOf was important and required all of that code.
>> Dan

View raw message