pkg
s and ns
es
#5
Labels
No Label
accepted
bug
clj
documentation
enhancement
errors
infrastructure
later
next
now
optimization
proposal
question
research
semantics
syntax
ux
vm
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: twc/ludus#5
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A
module
form could be interesting. It describes a namespace, but instead of an explicit associative data structure (as thens
form is currently), it would be followed by a block. It would then bundle up all the bindings in this block into an equivalent namespace.The following would then be equivalent:
This is not quite pure sugar: it relies on the plumbing of Ludus being able to do something with the context of the scope. But I think this is quite ergonomic.
module
the right name for this?ns
actually the name for this?ns
strategy the right one now that we don't have structs?Better names? A current
ns
should actually be a package,pkg
; the module proposal here is more properly called a "namespace."The revised, current strategy:
A namespace is a package; it exports all first-level bindings into the package.
Packages must have capitalized names; unlike dicts, they panic if you try to access a key that isn't on them.
Only packages may be used with the
use
form:use Foobar
, above, would loadfoo
,bar
, andbaz
into the local scope.use
may also only be used at the toplevel.Accepted, and implemented in scanner, parser, validator.
To consider: a `module` formto `pkg`s and `ns`esCurrent status, good enough for Computer Class, I think:
pkg
works and is validated.ns
access does not pass validation, and is not yet implemented in the interpreter.Foo :bar
is validated properly.