From 6ed5b9f6d3fdeeed8ecd43b18bae642ec1ec24b1 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Wed, 9 Feb 2022 01:16:03 +0000 Subject: Add much better memory handling (We now track and free Datum * structs) --- tests/chain.apl | 8 ++++++++ tests/queens.apl | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tests/chain.apl (limited to 'tests') diff --git a/tests/chain.apl b/tests/chain.apl new file mode 100644 index 0000000..c8efeb7 --- /dev/null +++ b/tests/chain.apl @@ -0,0 +1,8 @@ +worker←{ + msg←{1}⍇0 + ⎕←'Worker id ',(⍕⎕self),' got message: ',(⍕msg),' forwarding to ',⍕⍵ + ⍵≡⍬: ⎕←'DONE' + msg⍈⍵ +} +last←worker&⍣25⊢⍬ +_←'Hello there'⍈last diff --git a/tests/queens.apl b/tests/queens.apl index a2ce041..d372186 100644 --- a/tests/queens.apl +++ b/tests/queens.apl @@ -4,4 +4,7 @@ subs←{(⊂⍵)⍪¨(⍳⍴⊃⍺)~atk ⍵} accm←{⍺⍪((⍴⍵)=⍴⊃⍺)↑⊂⍵} fmt←{(⊂⎕io+⍵=⌾⍳⍴⍵)⌷'∘⎕'} queens←{fmt¨ 1↓(↓1 ⍵⍴0)accm dfs subs ⍬} -⎕←queens 5 +eightqueens←queens 8 +⎕←'Number of solutions to 8 queens: ',⍕≢eightqueens +⎕←'First five:' +⎕←5↑eightqueens \ No newline at end of file -- cgit v1.2.3