1.17 Ident

The KC3 Ident type is an identifier. An identifier evaluates to its bound value in the current environnement, that is in local and global frames and then in the triple store.

1.17.1 Examples

To get an Ident you can use quote :

ikc3> quote List.reverse
List.reverse
ikc3> type(quote List.reverse)
Ident

To bind a value to an ident you can use pattern matching :

ikc3> [one, two, three | rest] = List.count(5)
[1, 2, 3, 4, 5]
ikc3> type(quote one)
Ident
ikc3> one
1
ikc3> two
2
ikc3> three
3
ikc3> rest
[4, 5]

Otherwise you can use KC3.def and it will store the value in the graph database (facts) :

ikc3> def one = 1
1
ikc3> def two = one + one
2
ikc3> two
2