| author | wenzelm |
| Sat, 10 Aug 2024 20:20:59 +0200 | |
| changeset 80684 | 5b8fccf0a48a |
| parent 80462 | 7a1f9e571046 |
| permissions | -rw-r--r-- |
|
52530
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
1 |
/* Title: Pure/PIDE/document_id.scala |
|
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
|
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
3 |
|
|
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
4 |
Unique identifiers for document structure. |
|
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
5 |
|
|
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
6 |
NB: ML ticks forwards > 0, JVM ticks backwards < 0. |
|
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
7 |
*/ |
|
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
8 |
|
|
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
9 |
package isabelle |
|
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
10 |
|
|
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
11 |
|
| 75393 | 12 |
object Document_ID {
|
| 52531 | 13 |
type Generic = Long |
14 |
type Version = Generic |
|
15 |
type Command = Generic |
|
16 |
type Exec = Generic |
|
|
52530
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
17 |
|
| 52531 | 18 |
val none: Generic = 0 |
| 71601 | 19 |
val make: Counter = Counter.make() |
|
52530
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
20 |
|
| 63805 | 21 |
def apply(id: Generic): String = Value.Long.apply(id) |
22 |
def unapply(s: String): Option[Generic] = Value.Long.unapply(s) |
|
|
80462
7a1f9e571046
clarified signature: more explicit XML.Body types, more uniform Symbol.encode_yxml;
wenzelm
parents:
75393
diff
changeset
|
23 |
|
|
7a1f9e571046
clarified signature: more explicit XML.Body types, more uniform Symbol.encode_yxml;
wenzelm
parents:
75393
diff
changeset
|
24 |
def encode(id: Generic): XML.Body = XML.Encode.long(id) |
|
52530
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
diff
changeset
|
25 |
} |