Skip to content

Commit

Permalink
Add LanguagePlatform messages for GS64
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Nov 21, 2024
1 parent 2a0044f commit aae4422
Showing 1 changed file with 41 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
Class {
#name : 'GemStone64Platform',
#superclass : 'LanguagePlatform',
#category : 'Buoy-Metaprogramming-GS64-Extensions',
#package : 'Buoy-Metaprogramming-GS64-Extensions'
#name : 'GemStone64Platform',
#superclass : 'LanguagePlatform',
#category : 'Buoy-Metaprogramming-GS64-Extensions',
#package : 'Buoy-Metaprogramming-GS64-Extensions'
}

{ #category : 'class initialization' }
GemStone64Platform class >> initialize [

LanguagePlatform setCurrentTo: self new
LanguagePlatform setCurrentTo: self new
]

{ #category : 'reflection' }
GemStone64Platform >> atInstanceVariableNamed: name on: object put: value [

| index |
index := (object class allInstVarNames collect: #asSymbol)
indexOf: name asSymbol
ifAbsent: [ self error: ('<1s> not found in <2p>' expandMacrosWith: name asString with: object) ].
object instVarAt: index put: value
| index |
index := (object class allInstVarNames collect: #asSymbol)
indexOf: name asSymbol
ifAbsent: [ self error: ('<1s> not found in <2p>' expandMacrosWith: name asString with: object) ].
object instVarAt: index put: value

]

{ #category : 'process scheduling' }
GemStone64Platform >> fork: block named: processName at: priority [

| process |
process := self newProcessNamed: processName evaluating: block at: priority.
process resume.
Processor yield.
^process
| process |
process := self newProcessNamed: processName evaluating: block at: priority.
process resume.
Processor yield.
^process
]

{ #category : 'process scheduling' }
Expand All @@ -45,15 +45,28 @@ GemStone64Platform >> newProcessNamed: processName evaluating: block at: priorit
{ #category : 'reflection' }
GemStone64Platform >> globalNamed: aSymbol ifAbsent: absentBlock [

^ (GsCurrentSession currentSession symbolList objectNamed: aSymbol)
ifNil: absentBlock
^ (GsCurrentSession currentSession objectNamed: aSymbol)
ifNil: absentBlock
]

{ #category : 'reflection' }
GemStone64Platform >> globalNamed: symbol ifAbsentPut: block [

^ (GsCurrentSession currentSession objectNamed: aSymbol)
ifNil: [
| object |
object := block value.
(GsCurrentSession currentSession objectNamed: #Globals)
at: aSymbol put: object.
object
]
]

{ #category : 'reflection' }
GemStone64Platform >> includesGlobalNamed: aSymbol [

^ (GsCurrentSession currentSession symbolList objectNamed: aSymbol)
notNil
^ (GsCurrentSession currentSession objectNamed: aSymbol)
notNil
]

{ #category : 'message digest' }
Expand All @@ -65,5 +78,13 @@ GemStone64Platform >> messageDigest: string [
{ #category : 'accessing' }
GemStone64Platform >> os [

^ GemStone64UnixPlatform current
^ GemStone64UnixPlatform current
]

{ #category : 'reflection' }
GemStone64Platform >> removeGlobalNamed: aSymbol ifAbsent: absentBlock [

| globals |
globals := GsCurrentSession currentSession objectNamed: #Globals.
^ globals removeKey: aSymbol ifAbsent: absentBlock
]

0 comments on commit aae4422

Please sign in to comment.