Prev: howto embed tab character (#\Tab) in format directive string?
Next: macros for generating lambda functions at runtime
From: Mirko on 2 Nov 2009 08:36 On Nov 2, 3:12 am, Slobodan Blazeski <slobodan.blaze...(a)gmail.com> wrote: > I've written an article about lisp and array languages athttp://www.vector.org.uk/?vol=24&no=2&art=blazeski > where I lifted some code written in this newsgroup. Hope you won't sue > me :) > > cheers > Slobodan Bobi, Very interesting topic: I came to lisp from a vector/matrix language IDL (http://www.ittvis.com/ProductServices/IDL.aspx) A couple of comments and thoughts First, the j+ operator is similar to the .+ operator in nlisp Second, on the role of vectorized operators. Two comments: One problem with IDL was that a routine that was developed for a scalar operation could not be applied directly for vectorized inputs if it had any kind of conditionals or loops in it: if x>0 ... does not make sense when x is a vector. This would necessitate rewriting the routine to use array test operator, save the indices, and then loop over the indices that satisfied the test. The other problem is that when you have very nested operations with vectors, during each step, IDL might create (possibly large) temporary storage for intermediate results. For really big data-sets one would have to play tricks to make it allocate a large enough contigious block of memory, or do special declarations, to tell the compiler/ evaluator that what it was calculating was just temporary, and will be discarded soon. My take on these problems is that we really don't want/need vector operators. What we really want is an easy way to 1) develop, debug, and optimize a numerical routine for scalar parameters 2) Have an easy wrapper to call the routine with vector parameters (reader macros come to mind). This way we do not have to define a slew of new operators to mimic the effect of existing ones. In essence, I don't see a reason to exactly emulate J,Q, Matlab, IDL in CL, but have a way to easily achieve the same effect result the CL- way. I have some rough code that helps me with 2), but I am not happy with it. I will post it when I am happier with it. Mirko
From: Slobodan Blazeski on 3 Nov 2009 03:00
Thanks for the feedback. I wasn't aware of IDL's existence. I agree about large temporary results so I feel myself of array operators as being higher order abstraction that serves well many times but whenever I need to I coudl just do loops. regards Bobi |