emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Contribution to SES (resend)


From: Vincent Belaïche
Subject: Re: Contribution to SES (resend)
Date: Sat, 24 Apr 2010 21:35:59 +0200

Hello Stef & al.

[...]

>
>Fine by me, as long as it only affects the function that inserts the
>"(ses-range ...)" string.

That was my intention.

>Of course, maybe we could change the default ordering of ses-range.
>IIUC it was chosen arbitrarily (the result of the implementation rather
>than of design, AFAICT) and I expect that very few users of ses-range
>depend on this ordering.
>

This would be acceptable to me, but we should ensure backward
compatibility: we could raise `SES file format' to 3, and if the file
format is < 3, then all (ses-range X Y) in the sheet would be replaced
by (ses-range X Y <^). I can correct this submission in that respect if
this principle is agreed.

>
>Using #N=..#N# in code won't save memory because the byte-compiler will
>treat each #N# as a separate copy. 


[...]

I removed most of them, but for some I did not find a proper way to
factorise code without those constructs.
>
>No, it'd be OK.
>
>
>        Stefan

Thanks,

Here is a corrected ses.el + proposed Changelog with the following
changes:

1. no co-existance ses-range + ses-list, but extension of ses-range
   instead.

2. (eval (cdr (assq ...))) replaced by (case ...)

3. shorthand flags > < v ^ for one-dimensional ranges

4. _ flag to replace empty cells, with next item specifying the
   replacement value.

Please note the following:

1. There are still some #N= ... #N# construct (any idea welcome, how to
   remove them with keeping factorization and w/o using eval ---
   duplication of code seems to me more evil than using those construct.

2. I did not implemented the defcustom for flags to auto-insert at range
   insertion, I will do this in a subsequent submission.

3. How to change ses-range default readout direction is still open.

4. For this subsequent submission, I think it may be good to go even
   further with Calc interworking. Jay: your opinion is welcome. We
   could have in addition of vectorization some more of Calc packing,
   like building complex numbers from two cells. You could have for
   instance A1 -- D2 like this:

   | 1 | 2 | 3 | 4 |
   | 5 | 6 | 7 | 8 |

   and (ses-range A1 D2 >v ** cx) would yield 

   [[ (1, 2), (3, 4)][(5, 6), (7, 8)]]

   flag **, **1 and **2 would mean vectorization+packing, flag *- would
   mean packing only, so that (ses-range A1 D2 >v *- cx) would yield:

   ( (cplx 1 2) (cplx 3 4) (cplx 5 6) (cplx 7 8))

   packing type would be identified by some flag following **, **1, **2
   or *- like this:

   - cplx, cx or 1 => cartesian complex number

   - polar, pr, or 2 => polar complex number

   - hms, hs, or 3 => hms forms

   - etc...

   
Any feedback welcome.

   Vincent.

Attachment: ses.tgz
Description: Contribution to ses (ses-range)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]