Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update documentation for new imports

  • Loading branch information...
commit 32e9c812bb02ae907a128de2412c7577b64a2a0b 1 parent 6be68c7
Michael Homer authored

Showing 2 changed files with 13 additions and 5 deletions. Show diff stats Hide diff stats

  1. +8 3 doc/errata
  2. +5 2 doc/modules
11 doc/errata
@@ -22,9 +22,14 @@ which are not part of the language and are subject to change:
22 22 - Lists, constructed with [] and supporting indexing with [] and []:=
23 23 and methods size, push, pop, first, last, and indices.
24 24 - Multiple modules with separate compilation. A file foo.grace defines
25   - a module foo, which can be accessed in another module using the
26   - semi-standardised "platform.foo" or the deprecated "import foo".
27   - Module files must be found in the current directory. Dynamic modules
  25 + a module foo, which can be accessed in another module using an import
  26 + statement:
  27 + import "test/example" as eg
  28 + Module files must be in the current directory or inside "modules/"
  29 + next to the compiler. Imports should not use relative paths if the
  30 + importing module is expected to be imported itself. Only modules in
  31 + the current directory will be compiled implicitly; all others must be
  32 + already compiled using the correct path as the name. Dynamic modules
28 33 (like the built-in "unicode") are found at runtime next to the
29 34 executable. Types do not cross module boundaries. All methods and
30 35 top-level var and def statements bind methods on the module object.
7 doc/modules
@@ -35,7 +35,8 @@ of lists as argument, where the elements of the top-level list are lists
35 35 of the arguments to provide each part of the name.
36 36
37 37 A sample use might be:
38   - platform.mirrors.reflect(1).getMethod("+").request([[2]]) == 3
  38 + import "mirrors" as m
  39 + m.reflect(1).getMethod("+").request([[2]]) == 3
39 40
40 41 This module is only available in the native compiler.
41 42
@@ -109,7 +110,9 @@ CurlEasy objects support these methods:
109 110 Wraps CURLOPT_FOLLOWLOCATION.
110 111
111 112 A sample use might be:
112   - def req = platform.curl.easy
  113 + import "io" as io
  114 + import "curl" as curl
  115 + def req = curl.easy
113 116 req.url := "http://example.com/"
114 117 req.onReceive {d->
115 118 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.