Skip to content

Commit

Permalink
Implement EBin>>evaluateIn:
Browse files Browse the repository at this point in the history
NB: EBin refers to some polymorphic bop in an abstract way.
EBins are created in Sprite, which instantiates ΛPrimOps to
serve for this purpose.  This is a problem along the lines
of #194.
  • Loading branch information
shingarov committed Feb 28, 2024
1 parent abd42d6 commit e9fd355
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Refinements/EBin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ EBin >> bop: anObject [
bop := anObject
]

{ #category : #'term rewriting' }
EBin >> evaluateIn: anEvalEnv [
^(left evaluateIn: anEvalEnv)
perform: bop class smalltalkSelector
with: (right evaluateIn: anEvalEnv)
]

{ #category : #accessing }
EBin >> left [
^ left
Expand Down
5 changes: 5 additions & 0 deletions src/SpriteLang/BGe.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ BGe class >> operator [
BGe class >> rTypeSrc [
^'x:''a => y:''a => bool[zzz|zzz <=> (x >= y)]'
]

{ #category : #'reflect - embedding' }
BGe class >> smalltalkSelector [
^#>=
]
5 changes: 5 additions & 0 deletions src/SpriteLang/BGt.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ BGt class >> operator [
BGt class >> rTypeSrc [
^'x:''a => y:''a => bool[zzz|zzz <=> (x > y)]'
]

{ #category : #'reflect - embedding' }
BGt class >> smalltalkSelector [
^#>
]
5 changes: 5 additions & 0 deletions src/SpriteLang/BLe.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ BLe class >> operator [
BLe class >> rTypeSrc [
^'x:''a => y:''a => bool[zzz|zzz <=> (x <= y)]'
]

{ #category : #'reflect - embedding' }
BLe class >> smalltalkSelector [
^#<=
]
5 changes: 5 additions & 0 deletions src/SpriteLang/BLt.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ BLt class >> operator [
BLt class >> rTypeSrc [
^'x:''a => y:''a => bool[zzz|zzz <=> (x < y)]'
]

{ #category : #'reflect - embedding' }
BLt class >> smalltalkSelector [
^#<
]
5 changes: 5 additions & 0 deletions src/SpriteLang/BMinus.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ BMinus class >> operator [
BMinus class >> rTypeSrc [
^'x:int => y:int => int[v|v===(x-y)]'
]

{ #category : #'reflect - embedding' }
BMinus class >> smalltalkSelector [
^#-
]
5 changes: 5 additions & 0 deletions src/SpriteLang/BPlus.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ BPlus class >> operator [
BPlus class >> rTypeSrc [
^'x:int => y:int => int[v|v===(x+y)]'
]

{ #category : #'reflect - embedding' }
BPlus class >> smalltalkSelector [
^#+
]
5 changes: 5 additions & 0 deletions src/SpriteLang/BTimes.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ BTimes class >> operator [
BTimes class >> rTypeSrc [
^'x:int => y:int => int[v|v===(x*y)]'
]

{ #category : #'reflect - embedding' }
BTimes class >> smalltalkSelector [
^#*
]

0 comments on commit e9fd355

Please sign in to comment.