Re: [F-Script-talk] Dictionary and a shell command wanted :)
Brought to you by:
pmougin
From: Philippe M. <pm...@ac...> - 2006-08-24 10:06:13
|
Le 24 ao=FBt 06 =E0 11:48, Giovanni Giorgi a =E9crit : > Thank you very much! > > I have poked around the Cocoa library and seems very simple to use > with FScript :) > > Is planned some new extension to the language for creating small > classes in Fscript language itself? There is preliminary support for this, with a few limitations (no =20 call to super, access to instances variable through KVC...). A more =20 complete solution will eventually be provided. Here is a basic example where we create a new subclass of NSObject, =20 named MyClass, with three instance variables named a, b and c, and =20 define a simple method named method1: > NSObject subclass:'MyClass' instanceVariableNames:'a b c' MyClass > MyClass MyClass > MyClass setFSBlock:[:self :_cmd| 'Method ' ++ _cmd ++ ' called on ' ++ self printString] asInstanceMethod:#method1 > myInstance :=3D MyClass alloc init > myInstance method1 'Method method1 called on <MyClass: 0x4bb69c0>' Using the setFSBlock... methods you can also add methods to existing =20 Cocoa classes. For another approach, look at KFDecorator, from Ken Ferry at: http://homepage.mac.com/kenferry/software.html#KFDecorator > There are FScript porting to other O.S. for instance Linux and =20 > Windows? None that I'm aware of. Best, Philippe |