From 36f2f1199a847c5cea5155cb68908685532cbe7b Mon Sep 17 00:00:00 2001 From: crc Date: Thu, 3 Jan 2019 21:49:43 +0000 Subject: [PATCH] correct bugs in defstruct example FossilOrigin-Name: 68b78ac0df4d468b55062888ae464e4addb0d39fdbe5d4fe91763f2f1c36ca4e --- example/defstruct.forth | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/example/defstruct.forth b/example/defstruct.forth index bb59350..86a7bd3 100644 --- a/example/defstruct.forth +++ b/example/defstruct.forth @@ -9,8 +9,8 @@ This can be useful, so I'm doing something similar here. :make-helper (nsq-) [ d:create , ] dip does ; :make-struct (ns-) d:create , [ here swap fetch allot ] does ; ---reveal--- - :defstruct (sq-) - set:make dup set:length + :defstruct (sa-) + dup set:length [ n:dec swap [ 'ab 'aabab reorder '@ s:append [ fetch + fetch ] make-helper @@ -23,12 +23,12 @@ This can be useful, so I'm doing something similar here. ~~~ -'book [ 'title 'author 'subject 'book-id ] defstruct +'book { 'title 'author 'subject 'book-id } defstruct book 'A const -'The_Hobbit s:keep &A title! -'J.R.R._Tolkien s:keep &A author! -'Fantasy s:keep &A subject! +"The_Hobbit &A title! +"J.R.R._Tolkien &A author! +"Fantasy &A subject! :info (a-) [ subject@ ] [ author@ ] [ title@ ] tri