-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstructor.go
34 lines (26 loc) · 1018 Bytes
/
constructor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package idris_go_rts
import . "reflect"
//-------------------------------------------------------------------------------------------------
// Data structures
//-------------------------------------------------------------------------------------------------
type Con struct {
tag uintptr
args []interface{}
}
//-------------------------------------------------------------------------------------------------
// Constants
//-------------------------------------------------------------------------------------------------
const invalidTag = ^uintptr(0)
//-------------------------------------------------------------------------------------------------
// Creation/accessor functions
//-------------------------------------------------------------------------------------------------
func MakeCon(tag uintptr, args ...interface{}) Con {
return Con{tag, args}
}
func GetTag(con interface{}) uintptr {
if con != nil {
return ValueOf(con).Interface().(Con).tag
} else {
return invalidTag
}
}