Thursday, January 17, 2008

fun

в качестве тестового задания надо пропатчить babel! вот это я понимаю - подход! :)

Sunday, January 6, 2008

lisp vs haskell

okay, i started reading on haskell when i'm not reading SICP. haskell is also functional PL, so i'm not really losing focus alternating them. so second basic data structure in haskell is tuple(first being list, of course). it's an immutable set of object with the same type(types do play a major role in HS).

and tuple of 2 elements(pair) is of different type, than tuple of 3(triple) or more elements. there's a shortcut to get values from pair fst(1,2) == 1, snd(1,2) == 2.

but guess what, they ain't workin' on tuples of other sizes! not sure i'm following the logic of HS creators yet :)

so why i mentioned lisp - it's main data structure is list(no surprises, it's called LISt Processing after all). lists there are actually "linked lists", first element can be accessed as "car(list)", and rest of the list is "cdr(list)". so "car(cdr(list))" is a second element of the list. there's even a shortcut for it - "cadr".

and you can stuff any number of "a"'s or "d"'s there, to get the needed element(or list tail), "cdddr(list)" is "all list elements starting from fourth".

no limitations for lists of size 2! :)

Thursday, January 3, 2008

smalltalk

was reading an article about lisp and smalltalk, describing them as language of gods. i know a bit of lisp, reading my second book on it atm(structure and interpretation of computer programs), and i can imagine it being an ancestor of all the functional PL out there.

so smalltalk should be it's OO counterpart. so i went to read a wiki article on it and it's a *WOW* stuff. it's all been there for over 30 years. i mean - everything's an object, message passing, code blocks(hello python list comprehensions), temp variables(now that's where ruby got its |x| down the pipe), docstrings(easy one)!

there's a web framework written in smalltalk - seaside, so i think after finishing SICP i'll give them both a try.

next in the list of languages to dive into - haskell.