Programming

Lazy Parameter Evaluation in D Language

Written by on March 6, 2022 in D Language, Programming with 0 Comments
Lazy Parameter Evaluation in D Language

Languages such as C/C++ and Java follow an “eager” argument evaluation approach, where function arguments are evaluated before the function is entered. Of course, there are idioms and tricks that one can use to force “lazy” evaluation. The primary benefit of “lazy” parameter evaluation is that the parameter is evaluated only when it is used and […]

Continue Reading

Selective Unit Testing in D Language

Written by on February 23, 2022 in D Language, Programming with 0 Comments
Selective Unit Testing in D Language

In the last article, I briefly explained how D language has built-in support for performing unit tests. I feel this is an advantage over many current languages.  What if we want to run only a subset of unit tests? Although it is a good idea to run the unit tests every time there is a […]

Continue Reading

Support for Unit Testing in D Language

Written by on February 6, 2022 in D Language, Programming with 0 Comments
Support for Unit Testing in D Language

While I admire D language for many of its elegant and powerful features, two features stand out in my opinion. These are support for Design by Contract (DBC) and Unit Testing. I am a great fan of DBC and will cover that feature in a future article. Today I let me briefly touch upon D‘s […]

Continue Reading

Template Mixins in D Programming Language

Written by on January 23, 2022 in D Language, Programming with 0 Comments
Template Mixins in D Programming Language

When I heard the name Mixin for the first time in the context of Dlang, I imagined it would be something similar to the mixins of Common Lisp, but I was completely wrong!  Mixins are a very interesting feature of D language. They allow code to be “injected” into the source at “compile-time” and hence facilitate “meta […]

Continue Reading

Universal Function Call Syntax (UFCS) in D Language

Written by on January 9, 2022 in D Language, Programming with 0 Comments
Universal Function Call Syntax (UFCS) in D Language

One of the many “cool’ features of Dlang is “Universal Funcion Call Syntax”, which permits non-member functions to be invoked using the member function call syntax. When you add to this the fact that this applies not just to user-defined types but to primitive types as well, things get interesting.  Let us look at some […]

Continue Reading

Calling Lisp Functions from D Language

Written by on December 25, 2021 in D Language, LISP, Programming with 0 Comments
Calling Lisp Functions from D Language

After exploring “newLisp” in the past few posts, I would like to start looking at the “D Programming Language” (DLang). DLang has been around since 2001. It was originally created by Walter Bright and later Andrei Alexandrescu joined the team in 2007. The main inspiration for DLang was C++, although it uses ideas from other languages such […]

Continue Reading

The “net-eval” Function in “newLisp”

Written by on December 12, 2021 in LISP, newLisp, Programming with 0 Comments
The “net-eval” Function in “newLisp”

One of the cool things about “newLisp” is that despite its small fooprint, it comes with a lot of functionality built-in. For instance, if you are interested in distributed computing, it is pretty easy to get started. In this article, I will touch upon the net-eval function that allows an expression to be evaluated on a remote […]

Continue Reading

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

Top