Re: [pure-lang-users] C macros
Status: Beta
Brought to you by:
agraef
From: Eddie R. <er...@bm...> - 2008-08-25 22:44:36
|
On Mon, 2008-08-25 at 23:22 +0200, Albert Graef wrote: > Yes, sentinels. They're on my TODO list for 0.6, which I started working > on today (yes, you can already find some nifty new stuff in svn ;-). Great. MACROS :) GSL gives two methods of handling errors, (1) the gsl function returns success or failure (0, 1, or null for alloc) or (2) a gsl error handler that will abort the program. IMO, (2) cause too much havoc and you might like some type of a soft real time system for music. However, for (1) how about invoking a rule that can be overridden by the user like with the csv module? Two final things would be all I need to get matrices working (and I know your working on a type system): Some way to designate a matrix type. And a way to get at the fields of a struct. Then, I could write: a::Matrix + b::Matrix = m if ok when m = gsl_matrix_alloc (a->size1) (a->size2); c_ok = gsl_matrix_memcopy m a; a_ok = gsl_matrix_add m b; end; gsl_matrix returns it's value through the first parameter. So, to keep referential transparency, I need to copy a to m before adding. Somewhere in there I have to mark m for garbage collection as well. The only way to get matrices with complex entries or int entries is to go through the BLAS interface as I see it. Weird that I have to implement both the gsl_matrix_ stuff and BLAS but some of the later stuff uses the gsl_matrix_* routines. e.r. e.r. |