boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

015-lib-static-namespace.scm (773B)


      1 ;; --lib's prefix is a translation-unit namespace, not merely a string-literal
      2 ;; namespace.  Exercise every non-function-local label family directly.
      3 (let* ((cg (cg-init/v #t "tu7__"))
      4        (sty (%ctype 'fn -1 -1 (list %t-i32 '() #f)))
      5        (fn (%sym "helper" 'fn 'static sty #f #t))
      6        (var (%sym "state" 'var 'static %t-i32 #f #t)))
      7   (%hash-set! (car (world-scope (cg-world cg))) "helper" fn)
      8   (write-bv-fd 1 (%cg-sym-label cg var))
      9   (write-bv-fd 1 "\n")
     10   (cg-fn-begin cg "helper" '() %t-i32)
     11   (write-bv-fd 1 (%cg-fn-get cg '%fn-label))
     12   (write-bv-fd 1 "\n")
     13   (write-bv-fd 1 (%cg-slot-expr cg 24))
     14   (write-bv-fd 1 "\n")
     15   (write-bv-fd 1 (%cg-user-label cg "done"))
     16   (write-bv-fd 1 "\n")
     17   (write-bv-fd 1 (%cg-fresh-cl-label cg))
     18   (write-bv-fd 1 "\n"))