diff options
author | Thing1 <thing1@seacrossedlovers.xyz> | 2024-09-13 17:41:04 +0100 |
---|---|---|
committer | Thing1 <thing1@seacrossedlovers.xyz> | 2024-09-13 17:41:04 +0100 |
commit | f35cd6c1d15ce31cd5f1d1d578a7a2a4880c2179 (patch) | |
tree | 2037403e7a507aa45edb91c3d6078437800efb20 /comp/lucas-standen-NEA/code2/sample.zpy | |
parent | 4e3b919602046dd22d69c8d58839cb33b62b1a85 (diff) |
did structs, and layed the groundwork for function pointers
Diffstat (limited to 'comp/lucas-standen-NEA/code2/sample.zpy')
-rw-r--r-- | comp/lucas-standen-NEA/code2/sample.zpy | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/comp/lucas-standen-NEA/code2/sample.zpy b/comp/lucas-standen-NEA/code2/sample.zpy index 1eea0f4..57b954f 100644 --- a/comp/lucas-standen-NEA/code2/sample.zpy +++ b/comp/lucas-standen-NEA/code2/sample.zpy @@ -1,22 +1,9 @@ -(symbol putchar int c:int) -(symbol getchar int) - -(defun read char* str:char*) - (let count:int 0) - (for c:char (getchar) (!= c '\n') 0) - (set str[count] c) - (set c (getchar)) - (set count (+ count 1)) - (endfor) - (return str) -(endfun) +(struct ll) + (def data:void*) + (def next:ll*) +(endstruct) (defun main int) - (let str:char* (alloc 10)) - - (set str (read str)) - - (for i:int 0 (< i 10) 1) - (putchar str[i]) - (endfor) + (let node:ll* (alloc (sizeof ll*))) + (return 0) (endfun) |