News for hackers. Stuff that matters.
Re:Rapydscript: Python-like pre-compiler for JavaScript by rockdoe on Thursday April 16, 2015 @05:29AM (#9386757)
[2, 1] in [[1,2], [2, 1], [3, 5]]

Does it handle this? CoffeeScript was a bit too close to JS to get this correct.

Re:Rapydscript: Python-like pre-compiler for JavaScript by jdkanani on Thursday April 16, 2015 @05:39AM (#9386789)
I just checked it. RapydScript generates very logical code than CoffeeScript.

CoffeeScript:

    var ref;
    (ref = [2, 1]) === [1, 2] || ref === [2, 1] || ref === [3, 5] || ref === [3, 5];
RapydScript:

    function _$rapyd$_in(val, arr) {
        if (arr instanceof Array || typeof arr === "string") return arr.indexOf(val) != -1;
        else {
            if (arr.hasOwnProperty(val)) return true;
            return false;
        }
    }
    _$rapyd$_in([2,1], [[1,2], [2,1], [3,5], [3,5]]);
One thing I worried about RapydScript is generated variables. Pre-compiler needs to be scope aware. I am not sure how difficult or feasible it would be.