Skip to content

Commit

Permalink
Update to use CMOC 0.1.53
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Cho committed Oct 6, 2018
1 parent 8e81d47 commit d64c87e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CFLAGS=-O2 --limit=0x7fff --org=0x3d00 --intermediate
CFLAGS=-O2 --limit=0x7fff --org=0x3ae5
TARGET=minilisp.dsk
TARGET_BAS=$(TARGET:.dsk=.bas)
TARGET_BIN=$(TARGET:.dsk=.bin)
Expand Down
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh

export DOCKER_IMAGE=jamieleecho/coco-dev:0.8
export DOCKER_IMAGE=jamieleecho/coco-dev:0.10
docker run --rm --volume `pwd`:/home/coco-dev --workdir /home/coco-dev $DOCKER_IMAGE make "$@"
2 changes: 1 addition & 1 deletion minilisp.bas
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
100 PCLEAR 1
110 CLEAR100,&H3D00
110 CLEAR100,&H3AE5
120 REM FROM ALLEN HUFFMAN
130 FORA=0TO8:READA$:POKE &H3900+A,VAL("&H"+A$):NEXTA:EXEC&H3900:DATAC6,1,96,BC,1F,2,7E,96,A3
140 LOADM "MINILISP"
Expand Down
11 changes: 5 additions & 6 deletions minilisp.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#define static
#define ptrdiff_t int
#define false FALSE
#define const
#undef NULL
#define NULL 0
#define true TRUE
Expand Down Expand Up @@ -457,7 +456,7 @@ static Obj *cons(void *root, Obj **car, Obj **cdr) {
return cell;
}

static Obj *make_symbol(void *root, char *name) {
static Obj *make_symbol(void *root, const char *name) {
Obj *sym = alloc(root, TSYMBOL, strlen(name) + 1);
strcpy(sym->val.name, name);
return sym;
Expand Down Expand Up @@ -714,7 +713,7 @@ static Obj *read_list(void *root) {

// May create a new symbol. If there's a symbol with the same name, it will not create a new symbol
// but return the existing one.
static Obj *intern(void *root, char *name) {
static Obj *intern(void *root, const char *name) {
for (Obj *p = Symbols; p != Nil; p = p->val.cell.cdr)
if (strcmp(name, p->val.cell.car->val.name) == 0)
return p->val.cell.car;
Expand Down Expand Up @@ -1233,7 +1232,7 @@ typedef enum NUM_CMP_OPT {
NUM_CMP_OPT_LTE
} NUM_CMP_OPT;

static Obj *prim_num_cmp(void *root, Obj **env, Obj **list, NUM_CMP_OPT opt, char *label) {
static Obj *prim_num_cmp(void *root, Obj **env, Obj **list, NUM_CMP_OPT opt, const char *label) {
if (length(*list) != 2) {
error("Malformed %s\n", "=");
}
Expand Down Expand Up @@ -1303,7 +1302,7 @@ static Obj *prim_eq(void *root, Obj **env, Obj **list) {
return values->val.cell.car == values->val.cell.cdr->val.cell.car ? True : Nil;
}

static void add_primitive(void *root, Obj **env, char *name, Primitive *fn) {
static void add_primitive(void *root, Obj **env, const char *name, Primitive *fn) {
DEFINE2(sym, prim);
*sym = intern(root, name);
*prim = make_primitive(root, fn);
Expand Down Expand Up @@ -1404,7 +1403,7 @@ int main() {
swap_in_basic_for_print();
width(SCREEN_WIDTH);
swap_out_basic_after_print();
bprintf("Color Computer MiniLisp 0.5.1\n");
bprintf("Color Computer MiniLisp 0.5.2\n");
bprintf("Original by Rui Ueyama\n");
bprintf("CoCo port: Jamie Cho\n\n");
bprintf("Press <BREAK> to eval commands\n\n");
Expand Down

0 comments on commit d64c87e

Please sign in to comment.