As an ArgoUML contributor I'm going to blog my activities here, so that they may draw interest by other developers or help other developers when doing tasks similar to what I've done. AND(!) the grand vision that makes an Argonaut what he is, TO THRIVE IN THE BIG DANGEROUS WORLD, TAKING THE Argo TO A GOOD SHORE ;-))

Thursday, May 07, 2009

Common Lisp dynamic variables

One thing that Common Lisp has which is very powerfull is its dynamic variables. The following code ilustrates the concept:

CL-USER(124): (defvar *x* "Hello") ; *x* is a dynamic variable*X* 
CL-USER(125): (progn
                (let ((*x* "Ola")) ; establishes a dynamic environment for *x*
                  (format t "~a~%" *x*)
                  (setf *x* "Ciao")
                  (format t "~a~%" *x*)) ; end of the dynamic environment
                (format t "~a~%" *x*)) ; back to the initial dynamic environment
                                       ; *x* assumes its original binding 

Now if this is used with multiple processing and/or closures you get very powerful ways to separate things and a great amount of flexibility almost for nothing.

Wednesday, May 06, 2009

ArgoUML 0.28

Some time ago ArgoUML 0.28 was released. This is a release that contains some new features and plenty of bug fixes. Please come aboard if you're still on land and give us some feedback via ArgoUML mailing lists, ArgoUML users' wiki band forums or via a bug or enhancement report.

Common Lisp hacking with ABCL

I'm riding on a Linux Eee PC 901. For now I haven't installed a different distribution than the customized Xandros that comes with it... The freaking thing isn't booting from a FAT32 USB that I have...

So, and because the main flash drive is almost full, I don't have GCC to build a more mature Lisp. I'm therefore using Armed Bear Common Lisp (ABCL) for some entertainment hacking like solving Programming Praxis problems and reading Peter Seibel's Practical Common Lisp for a second time. ABCL has some quirkcs, like when I tried to build an SVN ccheckout with Sun's JDK 1.6, it had some compilation errors. Nothing serious, and, after some minutes, I was at the REPL in Emacs. For now I tested it with a basic subset of imperative and functional Lisp and it stood well. I wonder if someday I try to setup a Lisp REPL for ArgoUML with ABCL (check issue 3082: evaluating GEF support for template notation spike)...

Solution for Programming Praxis' Rail-Fence Cipher

I found Programming Praxis via Planet Scheme. The following is my solution to the Rail-Fence Cipher problem in Common Lisp [check out the excelente Common Lisp tutorial by Peter Seibel for learning the language].

My solution doesn't follow the solution proposed in Programming Praxis, because, after looking at the proposal, I think there might be a way to express it more mathematical. With this I mean that what we have is a transformation via a discrete wave pattern. That sounded a bit familiar to fourier transformation. If so, if it can be expressed as such, maybe it would be the cleanest way to do it...

So, for now, the solution I present here is based in the straight-forward non-functional algorithm that one gets if analysing the problem as manipulating a string based on a ciclic list of indexes.

Reader Shared items