Latest Story

Lazy evaluation in Javascript

By Vlastimil Adamovsky

The same problem solved in Javascript.
A sample code is shown below:
//*********begin lazy implementation************”
function lazy(funToRun)
{
var myRun = function() {
var res = funToRun();
myRun = function() { return res; }
»

Lazy evaluation in Smalltalk

By Vlastimil Adamovsky

The same problem solved in Smalltalk. I have come up with an interesting implementation for the lazy
A sample code to show how to use it follows:
|lazy toRun temp result|
“*********begin lazy implementation************”
lazy := [ :myFun| |myRun|
...

Lazy evaluation in C#

By Vlastimil Adamovsky

Sometimes you want to use a value, which takes a long time to compute, but you don’t want to compute it before you know that you really need it.  When you need it the very first time, it will be calculated and when you need… »


Programming challenge - have fun #2

By Vlastimil Adamovsky

If you are tired of  “monkey coding”, try to solve some interesting problems.
Requirement: There is an array of integers  from 1 to n.    1 and only 1 number is… »

Programming challenge - have fun #1

By Vlastimil Adamovsky
btree

If you are tired of  “monkey coding”, try to solve some interesting problems.
Requirement: There is a Binary search tree , write a program, which will calculate distance from one… »

Expert F# Listing 9-10

By Vlastimil Adamovsky

As I was learning F# from an excellent book “Expert F#”, I could not make the example (listing 9-10) work with the latest version of F#, which currently is 1.9.6.16
I… »