spook

A "game" for the 2023 Autumn Lisp Game Jam. Won first place! (from the bottom...)
git clone https://kaka.farm/~git/spook
Log | Files | Refs | LICENSE

spock-compiler.scm (1064B)


      1 ;;;; spock-compiler.scm
      2 
      3 
      4 (module spock-compiler (make-spock-state
      5 			spock-state-mstore
      6 			spock-state-options
      7 			spock-state?
      8 			current-spock-state
      9 			spock
     10 			spock-initialize)
     11 
     12 (import scheme (except (chicken base) join butlast))
     13 (import matchable
     14         (chicken file)
     15         (chicken port)
     16         (chicken pathname) 
     17         (chicken platform)
     18         (chicken sort)
     19         (chicken plist)
     20         (chicken string)
     21         (chicken pretty-print))
     22 
     23 (include "config")
     24 (include "misc")
     25 (include "expand")
     26 (include "core")
     27 (include "opt")
     28 (include "xref")
     29 (include "honu")
     30 (include "bind")
     31 (include "sections")
     32 (include "spock/library")
     33 (include "driver")
     34 (include "codegen")
     35 
     36 (define-record spock-state
     37   mstore
     38   options)
     39 
     40 ;;
     41 (set! make-spock-state
     42   (let ((make-spock-state make-spock-state)
     43 	(spock spock))
     44     (lambda options
     45       (make-spock-state (apply spock 'prepare options) options))))
     46 
     47 ;;
     48 (define current-spock-state (make-parameter #f))
     49 
     50 ;;
     51 (define (spock-initialize . options)
     52   (current-spock-state
     53    (apply make-spock-state options)))
     54 
     55 )