added new keywords to the compiler - ifnot, elsifnot

This commit is contained in:
hyunghwan.chung
2018-06-19 16:11:20 +00:00
parent 2c6072adf9
commit a6d72b928c
5 changed files with 72 additions and 18 deletions

View File

@ -28,8 +28,7 @@ class Collection(Object)
method detect: block
{
self do: [ :el | if (block value: el) { ^el } ].
^Error.Code.ENOENT
self detect: block ifNone: [ ^self error: 'not found' ].
}
method detect: block ifNone: exception_block
@ -43,7 +42,16 @@ class Collection(Object)
{
self subclassResponsibility: #add:.
}
*)
method collect: block
{
| coll |
coll := self class new: self basicSize.
self do: [ :el | coll add: (block value: el) ].
^coll
}
method select: condition_block
{
| coll |
@ -56,11 +64,9 @@ class Collection(Object)
{
| coll |
coll := self class new: self basicSize.
self do: [ :el | if (condition_block value: el) { } else { coll add: el } ].
self do: [ :el | ifnot (condition_block value: el) { coll add: el } ].
^coll
}
*)
method emptyCheck
{

View File

@ -219,6 +219,8 @@ class Fcgi.ParamRecord(Fcgi.Record)
if (aString notNil)
{
### TODO: implement this...
(*
(aString subStrings: %(char)) do: [:each |
equal := each indexOf: $=.
equal = 0
@ -226,8 +228,8 @@ class Fcgi.ParamRecord(Fcgi.Record)
ifFalse: [
tempFields
at: (each first: equal - 1)
put: (each allButFirst: equal)]
]
put: (each allButFirst: equal)]
] *)
}.
^tempFields

View File

@ -33,10 +33,10 @@ class System(Apex)
self.asyncsg := SemaphoreGroup new.
class := System at: class_name.
class := self at: class_name. ## System at: class_name.
if (class isError)
{
System error: ('Cannot find the class - ' & class_name).
self error: ('Cannot find the class - ' & class_name).
}.
## start the gc finalizer process