You can now download F-Script 2.0 alpha 6. It contains the latest developments, including:
- Better error detection and reporting when defining new classes
- Support in the runtime for subclassing F-Script classes in Objective-C
- A literal syntax for hexadecimal numbers (finally!). Standard Smalltalk syntax; e.g.,
- Support for using the
nilas a receiver
- Various internal improvements
In addition, there will be a couple of language adjustments in F-Script 2.0, and this alpha contains one of them, as described below.
In F-Script 1.x, equality and inequality operators (i.e.,
~=) are provided for all objects. They are implemented in a category of NSObject, and rely on the standard Cocoa
isEqual: method to determine equality.
This is convenient but leads to a small amount of added conceptual complexity in a few situations related to array programming. Since life is better when even the slightest unneeded complexity is taken away, F-Script 2.0 changes this (remember that F-Script integrates array programming and Cocoa together and we want to do it with zero impedance mismatch). In F-Script 2.0,
~= are no longer provided at the NSObject level. The standard generic method for testing objects equality in Cocoa is
isEqual:, and you can use it with F-Script too.
Of course, just removing
~= and be done with it would horribly break compatibility between F-Script 2.x and code written for F-Script 1.x. In addition, we would really miss these nice operators…
Well, don’t panic. While these operators are no longer provided by default for all objects, they are implemented for a number of objects, such as NSString, NSNumber, NSDate, NSValue, FSBoolean… This covers the vast majority of current and desirable usage and you can also implement them for your own classes if that make sense.
In addition, F-Script 2.x comes with the magic needed to maintain backward compatibility with existing code in the few remaining cases where your F-Script 1.x code might send
~= messages to objects that relied on the default implementation provided by the NSObject category in F-Script 1.x. In such cases, all will work as usual and F-Script will log a warning suggesting you change your code to use
If you want to, you can turn off this magic backward compatibility system by using the
MaintainFScript1EqualityOperatorsSemantics user default, on an per application basis. For instance, to turn it off for the F-Script application, type the following in the Mac OS X terminal:
defaults write org.fscript.fscriptapp MaintainFScript1EqualityOperatorsSemantics NO
To reactivate it, type:
defaults write org.fscript.fscriptapp MaintainFScript1EqualityOperatorsSemantics YES