Hi All, Trying to get started by working out (and understanding) some of the examples on opencog/atomspace/examples/guile <https://github.com/opencog/atomspace/tree/master/examples/guile>. I should have got started on it months ago, but I guess everything on its due time...
As I try to interface with the guile prompt, I find it hard to edit
mistakes. Thus, I am trying an approach of defining most nodes/links in a
file, loading it into guile, and running cog-execute! on some of the
actions I'd like taken. Unfortunately, it isn't doing what I wanted. For
example:
scheme@(guile-user)> (StateLink
... (PredicateNode "some property")
... (ListLink
... (ConceptNode "thing A")
... (ConceptNode "alt B")
... )
... )
$3 = (StateLink
(PredicateNode "some property")
(ListLink
(ConceptNode "thing A")
(ConceptNode "alt B")
)
)
scheme@(guile-user)> (define get-state
... (GetLink
... (StateLink
... (PredicateNode "some property")
... (VariableNode "$x")
... )
... )
... )
scheme@(guile-user)> (cog-execute! get-state)
$4 = (SetLink
(ListLink
(ConceptNode "thing A")
(ConceptNode "alt B")
)
)
However, if I try to define 'StateLink' and 'get-state' in a file called
'/opencog/apil/get-put.scm', then try the following:
scheme@(guile-user)> (load "/opencog/apil/get-put.scm")
$5 = (SetLink
)
scheme@(guile-user)> (cog-execute! get-state)
$6 = (SetLink
)
I get nothing when I run (cog-execute! get-state). Why is this the case?
Also, I wasn't able to change the %load-path for guile to include
'/opencog/apil' to default list. Is there a way to have to type
'/opencog/apil' everytime I want to load a file in that dir?
Attached is the get-put.scm file I tried to use.
--
You received this message because you are subscribed to the Google Groups
"opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit
https://groups.google.com/d/msgid/opencog/06a771fd-f202-4ad7-8f80-88d2d976286e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
get-put.scm
Description: Binary data
