1 /** This file is part of Shapes.
3 ** Shapes is free software: you can redistribute it and/or modify
4 ** it under the terms of the GNU General Public License as published by
5 ** the Free Software Foundation, either version 3 of the License, or
8 ** Shapes is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ** GNU General Public License for more details.
13 ** You should have received a copy of the GNU General Public License
14 ** along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 ** Copyright 2015 Henrik Tidefelt
21 /** Populate a namespace hierarchy.
34 /** Alias with absolute expansion, placed in the global namespace
38 /** The alias can be accessed using a relative identifier.
41 res: [Debug..locate (resolved_identifier_string K..Z..a)]
42 IO..•stdout << `Resolving ´ << [Debug..sourceof res] << ` within ´ << (resolved_identifier_string @@) << `: ´ << res << "{n}
48 /** Alias with relative expansion
49 ** The expansion is resolved relative to the current namespace (here ..W)
53 /** Expand the alias from a nested namespace.
57 res: [Debug..locate (resolved_identifier_string L..Z..a)]
58 IO..•stdout << `Resolving ´ << [Debug..sourceof res] << ` within ´ << (resolved_identifier_string @@) << `: ´ << res << "{n}
67 /** Expand the alias from the same namespace opened again.
70 res: [Debug..locate (resolved_identifier_string L..Z..a)]
71 IO..•stdout << `Resolving ´ << [Debug..sourceof res] << ` within ´ << (resolved_identifier_string @@) << `: ´ << res << "{n}
77 /** Namespace aliases are only followed for the first namespace name in a namespace path.
78 ** This is to allow an extension to use aliases for its own convenience, without the risk that
79 ** users of the extension create dependencies to these aliases.
81 ** This wouldn't work:
84 |** res: [Debug..locate (resolved_identifier_string W..L..Z..a)]
85 |** IO..•stdout << `Resolving ´ << [Debug..sourceof res] << ` within ´ << (resolved_identifier_string @@) << `: ´ << res << "{n}