Skip to content

Commit 77ca317

Browse files
committed
update: readme
1 parent 98c97d7 commit 77ca317

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

readme.md

+33-2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,43 @@ foo_test.sml
101101

102102
### PolyML
103103

104-
`PolyML.loadModule "/path/to/libsmlunit.poly"` for other project.
104+
To build, just `make`:
105+
106+
```sh
107+
$ make -f Makefile.polyml
108+
echo "" | poly -q --error-exit --eval 'PolyML.suffixes := ".sig"::(!PolyML.suffixes)' \
109+
--eval 'PolyML.make "src/main"' \
110+
--use export.sml \
111+
--eval 'PolyML.SaveState.saveModule ("libsmlunit.poly", SMLUnit)'
112+
Making main
113+
Making SMLUnit
114+
..
115+
Created structure SMLUnit
116+
```
117+
118+
Then you will get `./libsmlunit.poly` which is the collection of SMLUnit entities that can be loaded.
105119

106120
```sh
107121
$ poly
108122
> PolyML.loadModule "/path/to/libsmlunit.poly";
123+
signature ASSERT =
124+
sig
125+
..
126+
signature TESTRUNNER =
127+
sig type parameter val runTest: parameter -> Test.test -> unit end
109128
val it = (): unit
110-
>
111129
```
112130

131+
It is possible to loading directly to the REPL:
132+
133+
```sh
134+
$ poly --eval 'PolyML.suffixes := ".sig"::(!PolyML.suffixes)'
135+
> PolyML.make "src/main";
136+
Making main
137+
Making SMLUnit
138+
..
139+
structure SMLUnit: SMLUNIT
140+
val it = (): unit
141+
```
142+
143+

0 commit comments

Comments
 (0)