Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
in Search

Squirrel 3.0 preview

Last post 06-26-2008, 1:38 AM by Wahooney. 1 replies.
Sort Posts: Previous Next
  •  03-07-2008, 10:51 AM 2403

    Squirrel 3.0 preview

    here's the first snaphot of squirrel 3.0, is meant just as a preview. The doc is not updated yet and I haven't done extensive test yet. Feedback is welcome.

    here's the link http://www.squirrel-lang.org/stuff/squirrel_3.0_prealpha.tar.gz

    here are the changes:
    -added base keyword to call base methods in a class

    class A {
     function DoSomthing()
     {
      ::print("I'm A");
     }
    }

    class B extends A {
     function DoSomthing()
     {
      base.DoSomthing();
      ::print("I'm B");
     }
    }


    -removed delegate keyword and added setdelegate() and getdelegate() table builtin methods
    local xx = {
     bla = 10,
     foo = "asd"
    }

    local zz = {};

    zz.setdelegate(xx);

    -removed vargv and vargc keywords, now var args are passed as an array called vargv(as a paramter)
    function test(a,b,...)
    {
     if(vargv.len() > 0) {
      foreach(i,val in vargv)
       ::dosomething(i,val);
     }
    }

    -removed parent keyword added class getbase() and getdelegate() built in method
    -instanceof doesn't throw an exception if the left expression is not a class
    -lexical scoping for free variables(free variables are no longer in the second parameter list)

    //what used to be

    local outer = 10;
    function (a,b):(outter)
    {
     return a+b+outer;
    }

    //now is just

    local outer = 10;
    function (a,b)
    {
     return a+b+outer;
    }

    -sq_setprintfunc accept error func
    -sq_geterrorfunc()
    -error() built in function(works like print but prints using the errorfunc)
    -added native debug hook (look ar sq_setnativedebughook())

    ciao

    Alberto

  •  06-26-2008, 1:38 AM 2584 in reply to 2403

    Re: Squirrel 3.0 preview

    This all sounds great!

    I can't wait :D
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems