From 0efdd1f65a81e8197313bf7c16c8f5e85291628c Mon Sep 17 00:00:00 2001 From: Vivianne Langdon Date: Sun, 2 Jul 2023 00:08:23 -0700 Subject: [PATCH] Update to use the official selfish spawn. - Requires latest and greatest goblins, though. --- gib-gab-gob/actors.scm | 3 +-- gib-gab-gob/lib.scm | 18 ------------------ guix.scm | 1 - hall.scm | 29 ++++++++++++++--------------- 4 files changed, 15 insertions(+), 36 deletions(-) delete mode 100644 gib-gab-gob/lib.scm diff --git a/gib-gab-gob/actors.scm b/gib-gab-gob/actors.scm index 5f39749..b21b286 100644 --- a/gib-gab-gob/actors.scm +++ b/gib-gab-gob/actors.scm @@ -1,11 +1,10 @@ (define-module (gib-gab-gob actors) #:use-module (gib-gab-gob rps) - #:use-module (gib-gab-gob lib) ;; to go into goblins eventually! #:use-module (goblins) #:use-module (goblins vat) #:use-module (goblins actor-lib methods) #:use-module (goblins actor-lib sealers) - #:use-module (oop goops) + #:use-module (goblins actor-lib selfish-spawn) #:use-module (ice-9 match) #:use-module (ice-9 rdelim) #:export (^game-lobby ^client-picker)) diff --git a/gib-gab-gob/lib.scm b/gib-gab-gob/lib.scm deleted file mode 100644 index e82d99e..0000000 --- a/gib-gab-gob/lib.scm +++ /dev/null @@ -1,18 +0,0 @@ -(define-module (gib-gab-gob lib) - #:use-module (goblins) - #:export (selfish-spawn)) - -(define (selfish-spawn constructor . args) - - (define (^selfish bcom) - (lambda (self) - (bcom (apply constructor bcom self args)))) - - (let ((name (procedure-property constructor 'name))) - (set-procedure-property! ^selfish 'name name)) - - (let ((self (spawn ^selfish))) - (pk self) - ;; now transition to the version with self - ($ self self) - self)) diff --git a/guix.scm b/guix.scm index cad83e0..23ef3cb 100644 --- a/guix.scm +++ b/guix.scm @@ -85,4 +85,3 @@ "This project demonstrates both Rock Paper Scissors and Tic Tac Toe in Goblins!") (home-page "https://solarpunk.moe") (license license:gpl3+)) - diff --git a/hall.scm b/hall.scm index 9c7cb53..19cf802 100644 --- a/hall.scm +++ b/hall.scm @@ -17,20 +17,19 @@ ((directory "gib-gab-gob" ((compiled-scheme-file "actors") - (compiled-scheme-file "lib") (scheme-file "rps") (scheme-file "actors") - (compiled-scheme-file "rps") - (scheme-file "lib"))))) + (compiled-scheme-file "rps"))))) (tests ((directory "tests" ()))) (programs ((directory "scripts" - ((in-file "make-client") (in-file "make-host"))))) + ((in-file "make-client") + (in-file "make-host"))))) (documentation - ((text-file "ChangeLog") - (text-file "AUTHORS") - (text-file "NEWS") + ((text-file "README") + (text-file "HACKING") + (text-file "COPYING") (directory "doc" ((texi-file "version") @@ -39,11 +38,14 @@ (info-file "gib-gab-gob") (info-file "version") (texi-file "gib-gab-gob"))) - (text-file "COPYING") - (text-file "HACKING") - (text-file "README"))) + (text-file "NEWS") + (text-file "AUTHORS") + (text-file "ChangeLog"))) (infrastructure - ((in-file "pre-inst-env") + ((automake-file "Makefile") + (autoconf-file "configure") + (text-file ".gitignore") + (scheme-file "hall") (directory "build-aux" ((tex-file "texinfo") @@ -51,7 +53,4 @@ (text-file "missing") (text-file "install-sh") (text-file "mdate-sh"))) - (scheme-file "hall") - (text-file ".gitignore") - (autoconf-file "configure") - (automake-file "Makefile"))))) + (in-file "pre-inst-env")))))