On 10/28/05, Julian Suggate <[EMAIL PROTECTED]> wrote:
I love how everything is an _expression_! That's a cool feature.I have for a long time wanted to be able to delegate behaviour to child objects in a typesafe way. Something like this:interface B
{
function myFunc():String;
}class BImpl implements B
{
function BImpl(){}
function myFunc():String
{
return "Hello from BImpl!";
}
}class A implements B
{
delegate B _bDelegate:BImpl; //BImpl must implement B too
function A()
{
_bDelegate = new BImpl();
}
}class AClient
{
var _b:B;
function AClient()
{
_b = new A();
trace(_b.myFunc()); //traces "Hello from BImpl!"
}
}You can do this in AS2 with __resolve but it's messy and because it's not a language feature there is no static checking by the compiler.This construct allows the programmer to delegate behaviour declaratively and in a type-safe way, without mechanically going thru and writing functions like this:// ... in class A implements B ...function myFunc(){return _bDelegate.myFunc();}which is painful in terms of productivity, maintenance and readability of code.If you implement this, you will give OO a big boost in my mind.Either way, I think you're doing a bold and courageous thing Nicolas. All the best. You saved our bacon with MTASC. Can you do it again?:-)Cheers,JulesOn 10/28/05, Ralf Bokelberg <[EMAIL PROTECTED] > wrote:and pattern matching is a great feature too :)
r.
Ralf Bokelberg wrote:
> and before i forget, currying would be nice too
> Cheers,
> Ralf
>
> Ralf Bokelberg wrote:
>
>>Hi Nicolas,
>>
>>here are some thoughts, in no particular order.
>>
>>I'm not sure about the difference between member variables and
>>parameters, which have to be fully typed and local variables, which can
>>be derived. Normally i'm either in one or the other mode (of mind),
>>depending on the language i'm using. Mixing modes seems strange to me.
>>
>>I like the idea of beeing able to extend the language itself, like it is
>>possible in Lisp. I know it's a broad term, and i don't have a concrete
>>use case at hand, simply like the idea to extend the language without
>>having to write a compiler.
>>
>>Closures, like in _javascript_ or AS - an absolute must, i like them
>>better than anonymous classes.
>>
>>The enumerators are nice. Similar to c#, if i remember correctly.
>>
>>Have you seen the articles about Linq? Beeing able to search through
>>arrays, XML and sql databases in the same way looks great.
>>
>>Cheers,
>>Ralf.
>>
>>Nicolas Cannasse wrote:
>>
>>
>>
>>>Hi folks,
>>>
>>>The new still-unamed language specifications have been updated at
>>> http://ncannasse.free.fr/files/flexible.html . It now includes enumerators,
>>>Dynamic type parameters and a beginning of grammar rules.
>>>
>>>I would like to get comments about the design of the language : what are the
>>>features you've been dreaming about ? How should look for you the language
>>>you'll be happy to write in everyday at work ?
>>>
>>>It's an open discussion, so bring your ideas in . I have my own ones, but I
>>>think opening the design to everybody will result in a better result in the
>>>end.
>>>
>>>Have fun !
>>>
>>>Nicolas
>>>
>>>
>>>_______________________________________________
>>>osflash mailing list
>>> [email protected]
>>> http://osflash.org/mailman/listinfo/osflash_osflash.org
>>
>>
>>_______________________________________________
>>osflash mailing list
>> [email protected]
>>http://osflash.org/mailman/listinfo/osflash_osflash.org
>
>
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org
_______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
