New issue 135 by analogc...@gmx.net: TELL: lists: new features
http://code.google.com/p/toped/issues/detail?id=135
The features I want to request can be implemented by UDFs but since this is
a fundamental data-structure it would be nice to implement it on lower
level.
1.) get sub-lists from lists: (without destroying the original list)
example:
int list a = {1,2,3,4,5,6};
int list b = a[2:4]; //b == {3,4,5}, a is still {1,2,3,4,5,6}
2.) fundamental mathematical operations on lists at least for type int,
real.
example:
int list a = {1,2,3};
int list b = a + 3; //same for -, /, *
best
armin
Comment #1 on issue 135 by krustev....@gmail.com: TELL: lists: new features
http://code.google.com/p/toped/issues/detail?id=135
I'm not sure about 2.)
- First the syntax:-
An operation like "addition" for example could be confusing. Somebody could
associate it with adding a component to the list. The multiplication might
be associated with multiplying the number of list components (python folks
for example).
- It is not a generic case for all lists. It is an operation for the
numeric lists only.
- could be achieved with one line of code if we introduce some functions
like "range" or "index" then
int list a = {1,2,3}
foreach (int i; index(a)) a[i] = a[i]+3;
or
foreach (int i; range(0,len(a))) a[i] = a[i]+3;
(the above are just ideas)
ad 2.)
suggestion:
* all index operations should stay within the [] operator as it is already
the case
* all other operations on lists of numbers are done in the mathematical
sense (e.g. as it is implemented in Matlab)
Finally it is just a question of definition. I'm not sure if we should be
compatible to each available programming language.
The main reason for this request is because of performance, code simplicity
and readability. Mathematical operations on lists within a mathematical
task (and geometry is the main task in Toped ;) will be done regular. Thus,
the support of regular actions motivates their usage and elevates the
scripting language to a higher level.
Actually exact your implementation of the "scalar addition" is done in the
UDF-library (not yet checked in). But the main disadvantage is by sure that
for each list operation the number of computing tasks is much much higher
than with an predefined internal operator.
For now I don't have so large applications that performance is an issue.
So, I'm fine with the implementation as a script. But as you know,
everything under development rises with exponential progression (at least
stated by R. Kurzweil) ;)
Comment #3 on issue 135 by krustev....@gmail.com: TELL: lists: new features
http://code.google.com/p/toped/issues/detail?id=135
Updates implementing 1.) - in r2127
About 2.)
I understand the rationale behind the request and I agree with it - hence
the discussion is about the way to do it. I agree also that we don't have
to be compatible with all languages/scripts around but hey, this includes
Matlab :). Yet we can get ideas from there, what we do.
Seriously, the important point here is that those operations relate to a
certain type of lists - i.e. numerical ones.
I have number of suggestions:
- this seems to deserve a separate thread - so let's raise a separate issue
(scalar operations over lists) and continue the discussion there
- looking at it I found some dodgy points in our "foreach" implementation.
I'll do some additional tests and will eventually raise a separate issue
about it.
- I'll change the status to "Fixed", check the implementation of 1.) and
eventually close this issue.
This issue is now blocking issue 141.
See http://code.google.com/p/toped/issues/detail?id=141
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings