preparation for new 'is' operator; breaks bootstrapping again, sorry (use generated C code)
This commit is contained in:
parent
2d62738bbb
commit
6a8a409f1b
19 changed files with 86 additions and 203 deletions
|
|
@ -4,7 +4,7 @@ type
|
|||
TEventArgs = object of TObject
|
||||
type
|
||||
TEventEmitter = object of TObject
|
||||
events*: TTable[string, TDoublyLinkedList[proc(e : TEventArgs)]]
|
||||
events*: TTable[string, TDoublyLinkedList[proc(e: TEventArgs)]]
|
||||
proc on*(emitter: var TEventEmitter, event: string, func: proc(e: TEventArgs)) =
|
||||
if not hasKey(emitter.events, event):
|
||||
var list: TDoublyLinkedList[proc(e: TEventArgs)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
file: "tisopr.nim"
|
||||
file: "tofopr.nim"
|
||||
output: "falsetrue"
|
||||
"""
|
||||
# Test is operator
|
||||
|
|
@ -12,7 +12,7 @@ type
|
|||
TOtherType = object of TMyType
|
||||
|
||||
proc p(x: TMyType): bool =
|
||||
return x is TOtherType
|
||||
return x of TOtherType
|
||||
|
||||
var
|
||||
m: TMyType
|
||||
Loading…
Add table
Add a link
Reference in a new issue