Skip to content

Commit

Permalink
Merge pull request #312 from ichiban/assert-public
Browse files Browse the repository at this point in the history
a predicate created by {asserta, assertz}/1 must be public.
  • Loading branch information
ichiban authored Feb 18, 2024
2 parents 235fea6 + 5419eed commit d6ea349
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion engine/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ func assertMerge(vm *VM, t Term, merge func([]clause, []clause) []clause, env *E
}
p, ok := vm.procedures[pi]
if !ok {
p = &userDefined{dynamic: true}
p = &userDefined{public: true, dynamic: true}
vm.procedures[pi] = p
}

Expand Down
6 changes: 3 additions & 3 deletions engine/builtin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2577,7 +2577,7 @@ func TestAssertz(t *testing.T) {
assert.NoError(t, err)
assert.True(t, ok)

assert.Equal(t, &userDefined{dynamic: true, clauses: []clause{
assert.Equal(t, &userDefined{public: true, dynamic: true, clauses: []clause{
{
pi: procedureIndicator{
name: NewAtom("foo"),
Expand Down Expand Up @@ -2707,7 +2707,7 @@ func TestAsserta(t *testing.T) {
assert.NoError(t, err)
assert.True(t, ok)

assert.Equal(t, &userDefined{dynamic: true, clauses: []clause{
assert.Equal(t, &userDefined{public: true, dynamic: true, clauses: []clause{
{
pi: procedureIndicator{name: NewAtom("foo"), arity: 1},
raw: &compound{
Expand Down Expand Up @@ -2758,7 +2758,7 @@ func TestAsserta(t *testing.T) {
assert.NoError(t, err)
assert.True(t, ok)

assert.Equal(t, &userDefined{dynamic: true, clauses: []clause{
assert.Equal(t, &userDefined{public: true, dynamic: true, clauses: []clause{
{
pi: procedureIndicator{name: NewAtom("foo"), arity: 0},
raw: &compound{
Expand Down

0 comments on commit d6ea349

Please sign in to comment.