RSS

Recent news

Nice logging feature in Erlang

Ruslan Spivak - June 23, 2011

A

More (1 comments)

Array module in Erlang

Ruslan Spivak - April 14, 2008

Recent Erlang releases (since R12B) have array module included. Now binary search algorithm can be implemented quite efficiently with functional arrays: -module(bsa). -export([binsearch/2]). binsearch(Arr, Key) -> binsearch(Arr, Key, 0, array:size(Arr)). binsearch(Arr, Key, LowerBound, UpperBound) -> Mid = (LowerBound + UpperBound) div 2, Item = array:get(Mid,…

More (0 comments)

Erlang for Python programmers: Part V

Ruslan Spivak - November 16, 2007

Previous parts: Intro, Part I, Part II, Part III and Part IV List comprehensions. List comprehensions is very familiar topic for Python programmer. It’s a syntactic sugar which provides a succinct notation for producing elements in list. Erlang: [Expr || Qualifier1,...,QualifierN] Expr - is an…

More (0 comments)

Erlang for Python programmers: Part IV

Ruslan Spivak - October 02, 2007

Previous parts: Intro, Part I, Part II and Part III Funs - sequel Continuing previous post about functions let’s remember about Fun. I already mentioned it in Part I and promised to show its advanced forms. So, here we go. Fun with one clause: 1>…

More (0 comments)

Creating tables in Emacs

Ruslan Spivak - October 01, 2007

Sometimes I need to create tables in Emacs as it was in post describing comparison and arithmetic operations in Python and Erlang. Over time I became aware of several means to create tables and export them in different formats in Emacs(at the moment I’m personally…

More (0 comments)

Erlang for Python programmers: Part III

Ruslan Spivak - September 24, 2007

Previous parts: Intro, Part I and Part II Today we are going to take a look at functions. In Erlang there is no direct correspondence to what we have in Python: 1. default values, keyword arguments and formal parameter of form **name def foo(key, name='ruslan',…

More (1 comments)

comment-dwim and comment-style

Ruslan Spivak - September 21, 2007

In my previous post I mentioned that if you use Emacs and you’re editing Erlang source code you can easily comment whole marked region by invoking M-; to which by default bound interactive Lisp function comment-dwim. This works in different modes and it’s very handy…

More (0 comments)

Erlang for Python programmers: Part II

Ruslan Spivak - September 17, 2007

In this short tutorial we will take a look at comparison operations, some arithmetic operations and modules. You may also want to skim over Inro and Part I. Comparison operations Python Erlang Description Erlang Example --------+--------+-----------------------+---------------- < < strictly less than --------+--------+-----------------------+---------------- <= =< less…

More (0 comments)

How to say big numbers in English: Common Lisp

Ruslan Spivak - September 12, 2007

When i was describing notations and representation of numbers in Erlang(and Python) i forgot to mention very cool feature of format function in Common Lisp, with which i got acquainted exploring highly-recommended Practical Common Lisp book. This feature is ~R directive which knows how to…

More (0 comments)

Erlang for Python programmers: Part I

Ruslan Spivak - September 09, 2007

Let’s skim over data types in Erlang today. Check previous tutorial for introduction. Numbers In Erlang there are two types of numeric literals: integers and floats. In Python there are four of them: plain integers(usually called just integers), long integers, floating point numbers, and imaginary…

More (0 comments)

 1 2 >