Skip to content

SWI-Prolog Pack that Allows new Global Variable Syntax to Prolog

License

Notifications You must be signed in to change notification settings

logicmoo/gvar_syntax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SWI-Prolog Pack that adds a new Global Variable syntax to Prolog

Installation

Using SWI-Prolog 7.1 or later:

?- pack_install('https://github.com/TeamSPoon/gvar_syntax.git').

Source code available and pull requests accepted at http://github.com/TeamSPoon/gvar_syntax

?- use_module(library(gvar_syntax)).
true.

?- $foo.unify() = 1.
true.

?- $foo.unify() = 2.
false.

?- writeln($foo.get()).
1
true.

?- writeln($foo.get()).
1
true.

?- $foo.clear().
true.

?- writeln($foo.get()).
_8350

?- writeln($bar.set(2).get()).
2

?- $foo.set() = xxxxxxxx.
true.

?- $baz.set(point{ x: ($foo.get()) , y:vy, z:vz}).
true.

?- writeln($baz.get().x).
xxxxxxxx
true.

?- writeln($baz.x). % will error as you havent accessed the get()

Another Pack called dictoo adds better OO API on these values

Some TODOs

Document this pack!

Write tests

Untangle the 'pack' install deps (Moving predicates over here from logicmoo_base)

Not obligated to maintain a git fork just to contribute

Dislike having tons of forks that are several commits behind the main git repo?

Be old school - Please ask to be added to TeamSPoon and Contribute directly !

Still, we wont stop you from doing it the Fork+PullRequest method

Copyright (c) 2017, TeamSPoon and Douglas Miles logicmoo@gmail.com All rights reserved.

About

SWI-Prolog Pack that Allows new Global Variable Syntax to Prolog

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages