added a configure option to disable isocline
This commit is contained in:
@ -20,7 +20,7 @@ class IndexedCollection: Collection {
|
||||
}
|
||||
|
||||
class FixedSizedCollection: IndexedCollection {
|
||||
fun(#class) new(size) {
|
||||
fun[#class] new(size) {
|
||||
| obj iv |
|
||||
obj := (core.basicNew self size)
|
||||
if (self:respondsTo "initValue") { ## TODO: change "initValue" to a symbol once supported
|
||||
@ -28,34 +28,34 @@ class FixedSizedCollection: IndexedCollection {
|
||||
iv := (self:initValue)
|
||||
while (< i size) { ## TODO: change to i < size after having implemented these methods on integer/smallintger
|
||||
core.basicAtPut obj i iv
|
||||
i := (+ i 1) ## TODO: change to i + 1 ## TODO: change to i < size after having implemented these methods on integer/smallintger
|
||||
i := (i + 1) ## TODO: change to i + 1 ## TODO: change to i < size after having implemented these methods on integer/smallintger
|
||||
}
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
##fun ::initValue() {
|
||||
##fun[#class] initValue() {
|
||||
## return nil
|
||||
##}
|
||||
}
|
||||
|
||||
class(#varying) Array: FixedSizedCollection {
|
||||
class[#varying] Array: FixedSizedCollection {
|
||||
}
|
||||
|
||||
class(#char #varying) String: FixedSizedCollection {
|
||||
fun(#class) initValue() {
|
||||
class[#char #varying] String: FixedSizedCollection {
|
||||
fun[#class] initValue() {
|
||||
##return '\0'
|
||||
return ' '
|
||||
}
|
||||
}
|
||||
|
||||
class SequenceableCollection: Collection {
|
||||
fun iterate (action) {
|
||||
fun iterate(action) {
|
||||
| i x |
|
||||
i := 0; x := (self:size)
|
||||
while (i < x) {
|
||||
action:value (self:at i)
|
||||
i := (+ i 1)
|
||||
i := (i + 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ class Magnitude: Object {
|
||||
fun >= (oprnd) { return ((self < oprnd):not) }
|
||||
}
|
||||
|
||||
class(#limited) Number: Magnitude {
|
||||
class[#limited] Number: Magnitude {
|
||||
fun + (oprnd) { return (+ self oprnd) }
|
||||
fun - (oprnd) { return (- self oprnd) }
|
||||
fun * (oprnd) { return (* self oprnd) }
|
||||
|
@ -2,11 +2,11 @@ class Apex {
|
||||
fun isNil?() { return false }
|
||||
fun notNil?() { return true }
|
||||
|
||||
fun(#class) basicNew(size) {
|
||||
fun[#class] basicNew(size) {
|
||||
return (core.basicNew self size)
|
||||
}
|
||||
|
||||
fun(#class) respondsTo(mth) {
|
||||
fun[#class] respondsTo(mth) {
|
||||
return (core.classRespondsTo self mth)
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ class Apex {
|
||||
## TODO: fun perform(name ...) {}
|
||||
}
|
||||
|
||||
class(#uncopyable #varying #limited #final) Class: Apex [
|
||||
class[#uncopyable #varying #limited #final] Class: Apex (
|
||||
_name
|
||||
_mdic
|
||||
_spec
|
||||
@ -50,7 +50,7 @@ class(#uncopyable #varying #limited #final) Class: Apex [
|
||||
_ibrand
|
||||
_ivarnames
|
||||
_cvarnames
|
||||
] {
|
||||
) {
|
||||
fun name() {
|
||||
##return (core.className self)
|
||||
return _class
|
||||
@ -136,8 +136,8 @@ printf "----------------------------------------\n"
|
||||
k := #[1 2 3]
|
||||
printf "%O\n" (k:basicAt 2)
|
||||
|
||||
class (#varying) Z: Object [ a b c ] {
|
||||
fun(#classinst) new() {
|
||||
class [#varying] Z: Object (a b c) {
|
||||
fun[#classinst] new() {
|
||||
self.a := 10
|
||||
self.b := 20
|
||||
self.c := 30
|
||||
@ -153,7 +153,7 @@ fun Z:abc() {
|
||||
}
|
||||
|
||||
class Q {
|
||||
fun(#class) k () {
|
||||
fun[#class] k () {
|
||||
k := (Z:basicNew 10) ## #varying is really required? what is the big deal even if you allow it regardless?
|
||||
##k := (Z:new) ## no way to add extra fields.
|
||||
k:basicAtPut 2 "hello"
|
||||
|
Reference in New Issue
Block a user