From 0f72f268abcb48089e114c5895c5f20fcece6f7e Mon Sep 17 00:00:00 2001 From: RickBarretto <78623871+RickBarretto@users.noreply.github.com> Date: Thu, 30 May 2024 17:10:56 -0300 Subject: [PATCH] [examples/1] update importing --- examples/sample1.art | 50 +++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/examples/sample1.art b/examples/sample1.art index 07b84e4b0..1bff12242 100644 --- a/examples/sample1.art +++ b/examples/sample1.art @@ -8,45 +8,39 @@ ;; ;; Have fun! -do.import "grafito.art" +import {grafito}! -do [ - graph.create "sample1" [ - john: put 'person [s: "John" sex: 'm] - joan: put 'person [s: "Joan" sex: 'f] - bob: put 'person [s: "Bob" sex: 'm] - jill: put 'person [s: "Jill" sex: 'f] +graph.create "sample1" [ + john: put 'person [s: "John" sex: 'm] + joan: put 'person [s: "Joan" sex: 'f] + bob: put 'person [s: "Bob" sex: 'm] + jill: put 'person [s: "Jill" sex: 'f] - link'marriedTo john joan - link'childOf @[bob jill] @[john joan] - ] + link'marriedTo john joan + link'childOf @[bob jill] @[john joan] ] -do [ - benchmark [ - graph.verbose "sample1" [ +benchmark [ + graph.verbose "sample1" [ - print "getting first person named Joan..." - joan: what'person [s: "Joan"] - inspect joan + print "getting first person named Joan..." + joan: what'person [s: "Joan"] + inspect joan - print "getting all male people married to Joan..." - husband: what 'person [sex: 'm marriedTo: joan] - inspect husband + print "getting all male people married to Joan..." + husband: what 'person [sex: 'm marriedTo: joan] + inspect husband - ; inspect fetch 'person [ - ; marriedTo: what 'person [s: "Joan"] - ; ] + ; inspect fetch 'person [ + ; marriedTo: what 'person [s: "Joan"] + ; ] - preview fetch 'person ø - ] + preview fetch 'person ø ] ] -; do [ -; graph "sample1" [ -; preview fetch 'person ø -; ] +; graph "sample1" [ +; preview fetch 'person ø ; ] ; execute ~"dot -Tpng sample.dot -o sample.png"