Skip to content

Commit 7e3e66a

Browse files
committed
Reimplement most of the object system to align with AMOP.
Signed-off-by: Amy Ringo <me@remexre.com>
1 parent 03f119d commit 7e3e66a

File tree

4 files changed

+814
-285
lines changed

4 files changed

+814
-285
lines changed

doc/z/z-for-lispers.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ Z started life as a "modernized" Common Lisp variant, so lots of parts of it wil
44
Some notable Common Lisp-specific things are mentioned here.
55

66
- An [iterate](https://iterate.common-lisp.dev/)-like loop syntax is present instead of a `CL:LOOP`-like one.
7-
- The equivalent of a CL package is a Z module.
8-
The equivalent of a CL system is a Z package.
7+
- Many names are "modernized" to be more familiar to non-CL programmers.
8+
A few instances of this that might otherwise be confusing:
9+
- The equivalent of a CL package is a Z module.
10+
- The equivalent of a CL system is a Z package.
911
- Most modules are loaded from files with a scheme similar to `package-inferred-system`.
1012
- [Package-local nicknames](https://gist.github.com/phoe/2b63f33a2a4727a437403eceb7a6b4a3) are supported.
1113
- Most polymorphic functions are generic functions, similar to what [GENERIC-CL](https://gutev.dev/generic-cl/) does.
14+
- Z tracks dependencies between functions, so callers automatically get recompiled when an `INLINE` function is redefined.
15+
- Z's compiler has a more sophisticated inliner than most CL implementations, so `INLINE` is applied to function definitions by default.
16+
- There is a `MUST-INLINE` declaration to override the inliner's decisions.

src/zpy/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66

77
from pathlib import Path
88
from sys import argv
9-
from zval import ModuleZ
9+
from zval import Z
1010

1111

1212
def main(src_path: Path, *args: str):
1313
with src_path.open() as src_file:
1414
src = src_file.read()
1515

16+
print(Z["MAKE-INSTANCE"].call(Z["STANDARD-OBJECT"]))
1617
pass
1718

1819

0 commit comments

Comments
 (0)