Skip to content

Commit

Permalink
rename file ext from .mo to .ch
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Feb 24, 2024
1 parent 9868dba commit a88f5da
Show file tree
Hide file tree
Showing 267 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rename file ext from .mo to .ch
update to esmodule

fix repl for windows

# CHR
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Zero, Add1, One, Two } from "../../std/nat/index.mo"
import { Zero, Add1, One, Two } from "../../std/nat/index.ch"

clause Length([], n)
-------------------- {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Succeed, Fail } from "01-playthings.mo"
import { Null, Cons, Car, Cdr } from "02-teaching-old-toys-new-tricks.mo"
import { Succeed, Fail } from "01-playthings.ch"
import { Null, Cons, Car, Cdr } from "02-teaching-old-toys-new-tricks.ch"

clause List(l)
----------- {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Null, Cons, Car, Cdr } from "02-teaching-old-toys-new-tricks.mo"
import { Null, Cons, Car, Cdr } from "02-teaching-old-toys-new-tricks.ch"

clause Append(l, t, out)
------------------ {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Null, Cons, Car, Cdr } from "02-teaching-old-toys-new-tricks.mo"
import { Null, Cons, Car, Cdr } from "02-teaching-old-toys-new-tricks.ch"

clause Mem(x, l, out)
--------------- {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Succeed, Fail } from "01-playthings.mo"
import { Succeed, Fail } from "01-playthings.ch"

clause Always()
--------- {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
Positive,
GreaterThanOne,
Add,
} from "07-a-bit-too-much.mo"
} from "07-a-bit-too-much.ch"

clause Mul([], _m, [])
clause Mul(n, [], []) -- { Positive(n) }
Expand Down
16 changes: 8 additions & 8 deletions docs/diary/2022-12-01-namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ can be used in `prefix::name` syntax to reference a value.
A module can be imported as a namespace.

```cicada
import Exp from "exp.mo"
import Exp from "exp.ch"
```

Importing two modules as the same namespace,
the names in the the modules will be merged.

```cicada
import Exp from "exp.mo"
import Exp from "exp-extra.mo"
import Exp from "exp.ch"
import Exp from "exp-extra.ch"
```

Datatype can be used as a namespace,
Expand All @@ -42,18 +42,18 @@ the name in the module will also be imported,
if the name is bound to a namespace in the module,
the namespace will be merged.

Thus, to use the a datatype named `Exp` in the module "exp.mo",
Thus, to use the a datatype named `Exp` in the module "exp.ch",
we do not have to write:

```cicada
import Exp from "exp.mo"
import { Exp } from "exp.mo"
import Exp from "exp.ch"
import { Exp } from "exp.ch"
```

We can simply write:

```cicada
import Exp from "exp.mo"
import Exp from "exp.ch"
```

We can also provide a `namespace {}` keyword,
Expand All @@ -63,5 +63,5 @@ Use `import * from` to import all names without namespace prefix,
this feature can be used to reexport names in many modules from one module.

```cicada
import * from "exp.mo"
import * from "exp.ch"
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Lookup } from "Lookup.mo"
import { Lookup } from "Lookup.ch"

print find x {
Equal(map, [["a", 1], ["b", 2], ["c", 3]])
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions docs/std/array-map/index.ch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export import * from "Lookup.ch"
1 change: 0 additions & 1 deletion docs/std/array-map/index.mo

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Append } from "Append.mo"
import { Append } from "Append.ch"

print find [x, y] limit 6 {
Append(x, y, [1, 2, 3, 4, 5])
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions docs/std/array/index.ch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export import * from "Append.ch"
1 change: 0 additions & 1 deletion docs/std/array/index.mo

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FiniteDomain } from "FiniteDomain.mo"
import { FiniteDomain } from "FiniteDomain.ch"

function Different(values) {
return conj(arrayMapSpread(arrayCombination(values, 2), NotEqual))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FiniteDomain } from "FiniteDomain.mo"
import { FiniteDomain } from "FiniteDomain.ch"

// intervalDomain

Expand Down
1 change: 1 addition & 0 deletions docs/std/finite-domain/index.ch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export import * from "FiniteDomain.ch"
1 change: 0 additions & 1 deletion docs/std/finite-domain/index.mo

This file was deleted.

2 changes: 1 addition & 1 deletion docs/std/nat/Add.mo → docs/std/nat/Add.ch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Zero, Add1, Nat } from "Nat.mo"
import { Zero, Add1, Nat } from "Nat.ch"

export { Add }

Expand Down
4 changes: 2 additions & 2 deletions docs/std/nat/Add.test.mo → docs/std/nat/Add.test.ch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Zero, Add1, Nat } from "Nat.mo"
import { Add } from "Add.mo"
import { Zero, Add1, Nat } from "Nat.ch"
import { Add } from "Add.ch"

// trace steps 5 {
// Add1(add1(zero()), _x)
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/std/nat/Mul.mo → docs/std/nat/Mul.ch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Zero, Add1, Nat } from "Nat.mo"
import { Add } from "Add.mo"
import { Zero, Add1, Nat } from "Nat.ch"
import { Add } from "Add.ch"

export { Mul }

Expand Down
8 changes: 4 additions & 4 deletions docs/std/nat/Mul.test.mo → docs/std/nat/Mul.test.ch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Nat, Zero, Add1 } from "index.mo"
import { Add, Mul } from "index.mo"
import { One, Two, Three, Four, Five, Six } from "index.mo"
import { Seven, Eight, Nine, Ten, Eleven, Twelve } from "index.mo"
import { Nat, Zero, Add1 } from "index.ch"
import { Add, Mul } from "index.ch"
import { One, Two, Three, Four, Five, Six } from "index.ch"
import { Seven, Eight, Nine, Ten, Eleven, Twelve } from "index.ch"

print find z {
Two(x)
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions docs/std/nat/index.ch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export import * from "Nat.ch"
export import * from "Add.ch"
export import * from "Mul.ch"
export import * from "numbers.ch"
4 changes: 0 additions & 4 deletions docs/std/nat/index.mo

This file was deleted.

2 changes: 1 addition & 1 deletion docs/std/nat/numbers.mo → docs/std/nat/numbers.ch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Zero, Add1 } from "Nat.mo"
import { Zero, Add1 } from "Nat.ch"

export clause One(n) -- { Add1(prev, n) Zero(prev) }
export clause Two(n) -- { Add1(prev, n) One(prev) }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/tests/module/AB.mo → docs/tests/module/AB.ch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { A } from "./A.mo"
import { A } from "./A.ch"

export clause AB(a, b)
---------- {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/tests/module/ABC.mo → docs/tests/module/ABC.ch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AB } from "./AB.mo"
import { AB } from "./AB.ch"

export clause ABC(a, b, c)
-------------- {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Example from "./example.mo"
import * as Example from "./example.ch"

print find q {
Example.Hi(q)
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions docs/tests/module/import-all-private.error.ch
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * from "./example.ch"

print find q {
Hiya(q)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[evaluate] undefined name: Hiya

1 |import * from "./example.mo"
1 |import * from "./example.ch"
2 |
3 |print find q {
4 | Hiya(q)
Expand Down
5 changes: 0 additions & 5 deletions docs/tests/module/import-all-private.error.mo

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * from "./example.mo"
import * from "./example.ch"

print find q {
Hi(q)
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions docs/tests/module/import-private.error.ch
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Hiya } from "./example.ch"

print find q {
Hiya(q)
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Import.prepare]
can not import private name: Hiya
imported path: ./example.mo
imported path: ./example.ch
5 changes: 0 additions & 5 deletions docs/tests/module/import-private.error.mo

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { A } from "./A.mo"
import { A } from "./A.ch"

print find [x] {
A(x)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a88f5da

Please sign in to comment.