Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update documentation for new imports

  • Loading branch information...
commit 32e9c812bb02ae907a128de2412c7577b64a2a0b 1 parent 6be68c7
@mwh authored
Showing with 13 additions and 5 deletions.
  1. +8 −3 doc/errata
  2. +5 −2 doc/modules
View
11 doc/errata
@@ -22,9 +22,14 @@ which are not part of the language and are subject to change:
- Lists, constructed with [] and supporting indexing with [] and []:=
and methods size, push, pop, first, last, and indices.
- Multiple modules with separate compilation. A file foo.grace defines
- a module foo, which can be accessed in another module using the
- semi-standardised "platform.foo" or the deprecated "import foo".
- Module files must be found in the current directory. Dynamic modules
+ a module foo, which can be accessed in another module using an import
+ statement:
+ import "test/example" as eg
+ Module files must be in the current directory or inside "modules/"
+ next to the compiler. Imports should not use relative paths if the
+ importing module is expected to be imported itself. Only modules in
+ the current directory will be compiled implicitly; all others must be
+ already compiled using the correct path as the name. Dynamic modules
(like the built-in "unicode") are found at runtime next to the
executable. Types do not cross module boundaries. All methods and
top-level var and def statements bind methods on the module object.
View
7 doc/modules
@@ -35,7 +35,8 @@ of lists as argument, where the elements of the top-level list are lists
of the arguments to provide each part of the name.
A sample use might be:
- platform.mirrors.reflect(1).getMethod("+").request([[2]]) == 3
+ import "mirrors" as m
+ m.reflect(1).getMethod("+").request([[2]]) == 3
This module is only available in the native compiler.
@@ -109,7 +110,9 @@ CurlEasy objects support these methods:
Wraps CURLOPT_FOLLOWLOCATION.
A sample use might be:
- def req = platform.curl.easy
+ import "io" as io
+ import "curl" as curl
+ def req = curl.easy
req.url := "http://example.com/"
req.onReceive {d->
io.output.write(d.decode("utf-8"))

0 comments on commit 32e9c81

Please sign in to comment.
Something went wrong with that request. Please try again.