From 419d0d2cb956d3d58280887054a0ce660cababcf Mon Sep 17 00:00:00 2001 From: Koichi Nakamura Date: Sun, 10 Jan 2021 20:44:50 +0900 Subject: [PATCH] rename implementation to version --- README.md | 2 +- bootstrap.fs | 8 ++++---- others/planck.c | 4 ++-- others/planck.py | 8 ++++---- planck.xxd | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8b4e292..34c54cb 100644 --- a/README.md +++ b/README.md @@ -85,4 +85,4 @@ $ ./planck < bootstrap.fs example/fib.fs | } | shr | ( a b -- c ) | c = a >> b (logical) | | ) | sar | ( a b -- c ) | c = a >> b (arithmetic) | | v | argv | ( -- a-addr u ) | argv and argc | -| V | impl | ( -- c-addr ) | Implementation String | +| V | version | ( -- c-addr ) | Version String | diff --git a/bootstrap.fs b/bootstrap.fs index b7ec23b..5ecaf86 100644 --- a/bootstrap.fs +++ b/bootstrap.fs @@ -458,7 +458,7 @@ alias-builtin and & alias-builtin or | alias-builtin xor ^ alias-builtin u< u -alias-builtin implementation V +alias-builtin version V \ Rename existing FORTH words : >cfa G ; @@ -2070,7 +2070,7 @@ v argc ! argv ! ( === Environment-Dependent Code === ) -implementation s" hand-written i386-linux" streq [if] +version s" hand-written i386-linux" streq [if] %000 constant eax immediate %001 constant ecx immediate @@ -2401,7 +2401,7 @@ need-defined (read) words id. name>string name>link include included source >in - next-arg shift-args arg argv argc implementation + next-arg shift-args arg argv argc version [if] [unless] [else] [then] defined? open-file close-file write-file flush-file @@ -2457,7 +2457,7 @@ need-defined (read) next-arg dup argv @ ! included else - ." PlanckForth (implementation: " implementation type ." )" cr + ." PlanckForth (" version type ." )" cr ." Ready." cr s" /dev/tty" included then diff --git a/others/planck.c b/others/planck.c index 2beebc5..82c40e1 100644 --- a/others/planck.c +++ b/others/planck.c @@ -13,7 +13,7 @@ #include #include -#define IMPLEMENTATION "C" +#define VERSION "C" typedef uintptr_t cell; typedef void (**cfa)(); @@ -143,7 +143,7 @@ defcode("t", type) { putchar(pop()); next(); } defcode("x", exec) { (*(ip = (cfa) pop()))(); } defcode("f", find_) { push((cell) find(pop())); next(); } defcode("v", argv_) { push((cell) saved_argv); push(saved_argc); next(); } -defcode("V", impl) { push((cell) IMPLEMENTATION); next(); } +defcode("V", impl) { push((cell) VERSION); next(); } defcode("/", divmod) { intptr_t b = pop(); intptr_t a = pop(); diff --git a/others/planck.py b/others/planck.py index c43092e..da28514 100644 --- a/others/planck.py +++ b/others/planck.py @@ -9,7 +9,7 @@ import operator import array import ctypes -IMPLEMENTATION = "Python 3.x" +VERSION = "Python 3.x" MEMORY_SIZE = 0x10000 memory = array.array('i', [0]*MEMORY_SIZE) @@ -169,8 +169,8 @@ for addr in argv_addrs: comma(addr) # Version String -IMPLEMENTATION_ADDR = read(HERE_CELL) -comma_string(IMPLEMENTATION) +VERSION_ADDR = read(HERE_CELL) +comma_string(VERSION) align() def docol(ip, np): @@ -239,7 +239,7 @@ def argv(): push(ARGV_ADDR) push(len(sys.argv)) add_simple_operator('v', argv) -add_simple_operator('V', lambda: push(IMPLEMENTATION_ADDR)) +add_simple_operator('V', lambda: push(VERSION_ADDR)) SUCCESS = 0 ALLOCATE_ERROR = -59 diff --git a/planck.xxd b/planck.xxd index 58297f1..94c4b99 100644 --- a/planck.xxd +++ b/planck.xxd @@ -168,7 +168,7 @@ 000003b8: 0408 89c3 83c3 0453 movl %eax,%ebx; addl $4,%ebx; pushl %ebx 000003c0: ff30 adff 2000 0000 pushl (%eax); next; -000003c8: a883 0408 0156 0000 V: implementation +000003c8: a883 0408 0156 0000 V: version 000003d0: d483 0408 68dc 8304 pushl $version 000003d8: 08ad ff20 6861 6e64 next; hand 000003e0: 2d77 7269 7474 656e -written