Subject: Interpreting Arrows in Dogelog Player (Re: Nested Arrows in Dogelog Player)
Hi,
Dogelog Player has now arrow functions using a
)/2 operator. The semantics is different from
other offerings and based on ISO core standard
witness calculation [7.1.1.4]. Its genesis is
tied to formerly Jekejeke Prolog where we already
experimented with this semantics.
Departing from formerly Jekejeke Prolog we also
provide ahead of time compilation. It turns out
that this gives a better semantics, that can
solve problems such as mutual recursion and
nested arrows. We present a refinement for
interpretative use, that shares the same properties.
Nested functions have become quite popular in
programming languages such as Python and JavaScript.
More impressive inner functions can be returned
as values and can then serve as closures for
their outer context. Starting from variant
keys and a new unnumbervars/3 predicate, we
demonstrate the same for our preprocessed and
then interpreted '$ANON'/n compounds.
Bye
See also:
Interpreting Arrows in Dogelog Player
https://qiita.com/j4n_bur53/items/c67a660f3e52dd1ba448
Mild Shock schrieb:
Hi,
This post is Dedicated to the Memory of Scheme R4RS.
The ISO core standard witness calculation [7.1.1.4]
is the most hated among Prolog programmers, since it
produces false positive for nested (^)/2 occurences.
We show how to use it nevertheless for arrow
functions compilation.
We identified outside-in processing as the culprit
of false positives, the use of inside-out processing
then shows a promissing ability to minimize free
variable. We wish what we have done statically,
could also be done dynamically. But we are facing
serious new rational trees challenges.
Bye
See also:
Nested Arrows in Dogelog Player
https://medium.com/2989/1fd3fdc55ac3
Mild Shock schrieb:
Hi,
We recently made public a new version of Dogelog
Player that features arrow functions via the syntax
operator (=>)/2. An interesting mark of the current
release is that the arrow functions are automatically
compiled and decompiled inside static clauses.
Although our main use case was higher order logic
programming, an alternative use case is object
oriented logic programming. In particular we make a
short dive into the variant of so called prototype
based programming, also sometimes termed the
classless approach.
We use arrow functions (=>)/2 with a Pythonesk
self parameter, to give dicts properties that will
behave like methods. Creating copies, as sometimes
suggested by Logtalk, might work well for value
object. But to update an arrow function inside a
prototype, we used a non-backtracking mutator.
Bye
See also:
Prototype-Based Programming in Dogelog Player
https://qiita.com/j4n_bur53/items/3a68d42af9b86fce8bdf
--- PyGate Linux v1.5
* Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)