Skip to content
This repository was archived by the owner on Feb 9, 2020. It is now read-only.
This repository was archived by the owner on Feb 9, 2020. It is now read-only.

Compile limited lambda syntax into predicates #13

Description

@mndrix

Teach library(func) how to compile a predicate defined using lambda syntax and assigned to a variable. Like,

F = \X^Y^foo(stuff,Y,X),
...

% becomes

F = func:'5ecbc7c6883139e60b5db16550e8b5fc5da0244a',
...

func:'5ecbc7c6883139e60b5db16550e8b5fc5da0244a'(X,Y) :-
    foo(stuff,Y,X).

In certain circumstances, this technique can improve performance.

However, the main goal is to give users a convenient way to define predicates that are local to a clause. Without this feature, one must create a globally unique name for the predicate and risk it being called where it wasn't intended. This approach effectively keeps the auxiliary predicate definition local to the clause that uses it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions