Clean 3.0 is now available for Windows and Linux (32 and 64 bit) and Mac OS X (64 bit) at:
https://wiki.clean.cs.ru.nl/Download_Clean New in version 3.0: - Clean now use a FreeBSD license. Previously LGPL was also used. - On Mac OS X the compiler generates object code directly, instead of assembly. - Added cpm (Clean Project Manager), a command line tool that uses the same build system and project files as the CleanIDE. - StdEnv: - seq,seqList,::St,bind and return are no longer imported by module StdEnv, but are still defined in module StdFunc - added module StdFunctions, containing all definitions from module StdFunc except seq,seqList,::St,bind and return - module StdEnv imports module StdFunctions instead of StdFunc - added import of module StdStrictLists to module StdEnv - in module StdGeneric: added types RECORD and GenericRecordDescriptor, added instance of bimap for RECORD, removed type GenericInfo and field gcd_fields - Language extensions: - Hierarchical modules. The module name can be used to specify the directory containing the module. In that case the module name is the list of folder names of the directory, separated by .'s, followed by a . and the file name. For example the implementation module X.Y.Z is stored in file X/Y/Z.icl (file Z.icl in subfolder Y of folder Z). The path containing the first folder (X in this case) should be added to the search path for the compiler. - Generics: - The generic representation of records now uses the RECORD constructor instead of the OBJECT and CONS constructors. - Instances of generic functions for the generic representation types (UNIT,PAIR,EITHER,OBJECT,CONS,RECORD,FIELD) may be defined in definition modules (instead of a derive) using the same syntax as used in implementation modules. This makes it possible for the compiler to optimise derived generic functions in other modules. - In definition modules the used generic info fields for generic instances of OBJECT, CONS, RECORD and FIELD can be specified by adding: "of" and the pattern, at the end of the derive statement. The compiler uses this to generate better code. For example if g2 is defined as: generic g2 a :: a -> Int; g2{|CONS of {gcd_name}|} _ _ = size gcd_name; add "of {gcd_name}" in the definition module: derive g2 CONS of {gcd_name}; g2 for CONS will be called with just a gcd_name, instead of a GenericConsDescriptor record. - In definition modules unused generic function dependencies for generic instances can be specified by adding: "with" and the list of dependencies, but using _ for unused dependencies. The compiler uses this to generate better code. For example if the implementation module defines: generic g1 a :: a -> Int; generic g2 a :: a -> Int; generic h a | g1 a, g2 a :: a -> Int; h{|OBJECT of {gtd_name}|} _ g1 _ (OBJECT a) = g1 a+size (gtd_name); add "with _ g1 _" in the definition module: derive h OBJECT of {gtd_name} with _ g1 _; h for OBJECT will be called without a function argument for h (for a of OBJECT), with g1 and without g2, because h and g2 are not used by the implementation. - Expressions: - v =: PATTERN in an expression yields True if the expression matches the PATTERN and False otherwise. Variable names are not allowed in the PATTERN, but _'s may be used. The compiler optimizes the case where the pattern consists of just a constructor, optionally followed by _'s. Otherwise it is transformed to a case expression. The parser accepts additional _'s at the end of the pattern, so x=:(Constructor _ _) may be written as x=:Constructor _ _. For example: :: T = X Int | Y Int Int | Z; is_X_or_Y :: T -> Bool; is_X_or_Y t = t=:X _ || t=:Y _ _; - =: cannot be used anymore to define variables, - #, #! and | may be used in \ expressions. For example: f :: Bool -> .(Int -> (Int,Int)); f x = (\ y #! a=1; | x -> (y,a) # b=2; -> (a+b,y) ); - Types - extensible algebraic types can be defined by adding | .. to the algebraic type definition (or just .. without constructors). In other modules additional constructors may be added (once per module) by using | in the definition instead of = . For example, to define extensible type T with constructor A: :: T = A Int | .. To extended T with constructor B in another module: :: T | B Int Int _______________________________________________ clean-list mailing list [email protected] https://mailman.science.ru.nl/mailman/listinfo/clean-list
