Understanding the “unify” Function in “newLisp”

Written by on November 28, 2021 in newLisp, Programming with 0 Comments
Understanding the “unify” Function in “newLisp”

Unification between two symbolic expressions involves finding substitutions for variables (if any) in the expressions such that the expressions match after applying the substitutions. This is a powerful idea and is quite common in logic programming languages such as Prolog. Interestingly, “newLisp” has a buil-in function called “unify” that can be used for unifying two expressions. […]

Continue Reading

Currying in “newLisp”

Written by on November 14, 2021 in newLisp, Programming with 0 Comments
Currying in “newLisp”

In the last two articles, I discussed what I believe are some interesting features of “newLisp”. Today’s topic is “currying”, another useful feature. For those of you who are new to this topic, I had earlier written about “currying” in Mathematica here. You may want to take a look at that too. Unlike, for example, […]

Continue Reading

Implicit Indexing and Slicing in “newLisp”

Written by on November 1, 2021 in newLisp, Programming with 0 Comments
Implicit Indexing and Slicing in “newLisp”

In traditional Lisp (Common Lisp), when evaluating an S-expression list, the first element in the “functor” position must be a function or valid operator. newLisp relaxes this requirement and allows the first element to be a context symbol type, a list, an array, or an integer. For today’s discussion, let us ignore the context symbol, but […]

Continue Reading

Some Interesting Features of “newLisp”

Written by on October 17, 2021 in newLisp, Programming with 0 Comments
Some Interesting Features of “newLisp”

newLisp is a general-purpose scripting language with a Lisp-like syntax. That is one of the reasons I wanted to take a closer look at the language. It has a compact footprint, small resource requirements, and can easily be embedded. It is available on multiple platforms, and on my Windows machine, the installation has just two […]

Continue Reading

Using Sicstus Prolog with LMDB

Written by on October 3, 2021 in Programming, Prolog with 0 Comments
Using Sicstus Prolog with LMDB

In an earlier article, I showed how Sicstus Prolog allows us to use Berkeley DB for storage and retrieval of terms using the file system. Interestingly, the latest release of Sicstus Prolog, version 4.7.0, deprecates the Berekely DB library, while recommending an alternative implementation based on Lightning Memory-Mapped Database Manager (LMDB). The library interfaces are […]

Continue Reading

C++ 20: Concepts

Written by on September 19, 2021 in C++, Programming with 0 Comments
C++ 20: Concepts

Concepts, introduced in C++20, are predicates that act as contraints on template parameters. As you would expect, the nice thing is that the constraint checking happens as part of template instantiation at compile time and not at run time! Since templates can have type as well as non-type parameters, Concepts can be applied to both […]

Continue Reading

Ring Language: Dynamic Behavior of Classes and Objects

Written by on September 4, 2021 in Programming, Ring Language with 0 Comments
Ring Language: Dynamic Behavior of Classes and Objects

We have been exploring the Ring Programming Language in the last two articles. Ring is a dynamic programming language with many interesting features. In today’s article, let us try to understand how this dynamic behavior is reflected in Classes and Objects. In Ring, we can define classes at runtime. One way to do this is to execute […]

Continue Reading

“Loop” Command in Ring Programming Language

Written by on August 21, 2021 in Programming, Ring Language with 0 Comments
“Loop” Command in Ring Programming Language

In my last article, I had written about how easy it is to execute Ring code from within C/C++. Today’s article takes a look at the “Loop” command. This command is very similar to “continue” in many languages such as C++, Java, Python. etc. It is used to skip the rest of the statements inside […]

Continue Reading

First Encounter with the Ring Programming Language

Written by on August 7, 2021 in C++, Programming, Ring Language with 0 Comments
First Encounter with the Ring Programming Language

The Ring Programming Language, designed by Mahmoud Fayed,  has been around since 2016. I came to know of it quite accidentally two weeks ago when I received a promotional email from Apress about their book “Beginning Ring Programming” by Mansour Ayouni, published in 2020. I immediately did a google search about the language and finding […]

Continue Reading

Sentence Negation

Written by on July 18, 2021 in Natural Language Processing, Programming, Prolog with 0 Comments
Sentence Negation

In the last article, I talked about determining sentence types automatically. Another interesting task is to generate the “negation” of a given sentence. Example-1: Sentence => “My teacher lives nearby” Negation => “My teacher does not live nearby” Example-2: Sentence => “She did not like that speech” Negation => “She liked that speech” I have […]

Continue Reading

Top