First shot of libt and some examples
libt serves (well, might serve at some point) as a basic
library for Tea language. Added directory with examples
demostration Tea (and libt)
Both includes makefiles to compile libt and examples to
compile them down to machine code. This also demonstrates
how to use `teak`, a standalone Tea compiler.
nil subclass: #tSIntegerW
category: 't-Kernel'
!
!tSIntegerW methodsFor: 'comparing'!
< another <tSIntegerW> <^tBoolean>
<primitive: [:asm |
asm ret: (asm icmp: self _: another cond: LLVMIntSLT)
]>
!
> another <tSIntegerW> <^tBoolean>
<primitive: [:asm |
asm ret: (asm icmp: self _: another cond: LLVMIntSGT)
]>
!
= another <tSIntegerW> <^tBoolean>
<primitive: [:asm |
asm ret: (asm icmp: self _: another cond: LLVMIntEQ)
]>
! !
!tSIntegerW methodsFor: 'arithmetic'!
+ another <tSIntegerW> <^tSIntegerW>
<primitive: [:asm |
asm ret: (asm add: self _: another)
]>
!
- another <tSIntegerW> <^tSIntegerW>
<primitive: [:asm |
asm ret: (asm sub: self _: another)
]>
!
* another <tSIntegerW> <^tSIntegerW>
<primitive: [:asm |
asm ret: (asm mul: self _: another)
]>
! !