P
Parkinbot
Tue, Nov 15, 2016 9:33 PM
Isn't that "easy to implement stuff" that almost everybody has in one of his
libraries?
function prepend(val, L) = concat([val], L);
function append(L, a) = concat(L, [cal]);
function cut(L,n) = let (l = len(L)) //[] -> [[],[]]
n>l||n<0?undef
:[n==0?[]:[for (i=[0:n-1]) L[i]],
n==l?[]:[for (i=[n:len(L)-1]) L[i]]];
function insertVal(L, val, n) = // [,a,b,]->[,a,val,b,]
let(parts = cut(L, n))
parts[0]==undef||parts[1]==undef?undef
:concat(parts[0], [val], parts[1]);
function insertSubList(L, Sub, n) = // [,a,b,]->[,a,Sub,b,]
let(parts = cut(L, n))
parts[0]==undef||parts[1]==undef?undef
:concat(parts[0], Sub, parts[1]);
function setVal(L, val, n) = let (l = len(L)) // [,a,]->[,val,]
n>l||n<0?undef
:[for (i=[0:l]) i==n?val:L[i]];
function setSubList(L, SubList, n) = // [,,]->[,each SubList,*]
let(l=len(L), l1=len(SubList))
n>l||n<0?undef
:[for (i=[0:max(l,n+l1)-1])
i
<
n+l1&&i
>
=n?SubList[i-n]:L[i]];
Isn't that "easy to implement stuff" that almost everybody has in one of his
libraries?
> function prepend(val, L) = concat([val], L);
>
> function append(L, a) = concat(L, [cal]);
>
> function cut(L,n) = let (l = len(L)) //[] -> [[],[]]
> n>l||n<0?undef
> :[n==0?[]:[for (i=[0:n-1]) L[i]],
> n==l?[]:[for (i=[n:len(L)-1]) L[i]]];
>
> function insertVal(L, val, n) = // [*,a,b,*]->[*,a,val,b,*]
> let(parts = cut(L, n))
> parts[0]==undef||parts[1]==undef?undef
> :concat(parts[0], [val], parts[1]);
>
> function insertSubList(L, Sub, n) = // [*,a,b,*]->[*,a,Sub,b,*]
> let(parts = cut(L, n))
> parts[0]==undef||parts[1]==undef?undef
> :concat(parts[0], Sub, parts[1]);
>
> function setVal(L, val, n) = let (l = len(L)) // [*,a,*]->[*,val,*]
> n>l||n<0?undef
> :[for (i=[0:l]) i==n?val:L[i]];
>
> function setSubList(L, SubList, n) = // [*,*,*]->[*,each SubList,*]
> let(l=len(L), l1=len(SubList))
> n>l||n<0?undef
> :[for (i=[0:max(l,n+l1)-1])
> i
> <
> n+l1&&i
> >
> =n?SubList[i-n]:L[i]];
--
View this message in context: http://forum.openscad.org/Regarding-the-multiple-generator-expression-in-the-snapshot-2016-10-4-tp19098p19121.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
R
runsun
Tue, Nov 15, 2016 9:52 PM
@Parkinbot, yea.
But, if "everyone" has to do this, I would say make it a built-in so we have
a consistent behavior. For example, my prepend is prepend(L,val), which is
different from yours. Ronald's append is append(val, L), which is different
from both of ours. Only 3 users but we have 3 different sets of
prepend/append already.
$ Runsun Pan, PhD $ libs: doctest , faces ( git ), offline doc ( git ), runscad.py ( 2 , git ), synwrite ( 2 ); $ tips: hash ( 2 ), matrix ( 2 , 3 ), sweep ( 2 , 3 ), var ( 2 ), lerp , animation ( gif , prodVid , animlib ), precision ( 2 ), xl-control , type , rounded polygon , chfont , tailRecur ( 2, 3 ), isosphere ( 2 ), area , vol/center , RGB , CurvedImg , tests ( 2 ), text ; $ Apps: rollApp , blockscad , openjscad , on AWS ( pdf )
View this message in context: http://forum.openscad.org/Regarding-the-multiple-generator-expression-in-the-snapshot-2016-10-4-tp19098p19122.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
@Parkinbot, yea.
But, if "everyone" has to do this, I would say make it a built-in so we have
a consistent behavior. For example, my prepend is prepend(L,val), which is
different from yours. Ronald's append is append(val, L), which is different
from both of ours. Only 3 users but we have 3 different sets of
prepend/append already.
-----
$ Runsun Pan, PhD $ libs: doctest , faces ( git ), offline doc ( git ), runscad.py ( 2 , git ), synwrite ( 2 ); $ tips: hash ( 2 ), matrix ( 2 , 3 ), sweep ( 2 , 3 ), var ( 2 ), lerp , animation ( gif , prodVid , animlib ), precision ( 2 ), xl-control , type , rounded polygon , chfont , tailRecur ( 2, 3 ), isosphere ( 2 ), area , vol/center , RGB , CurvedImg , tests ( 2 ), text ; $ Apps: rollApp , blockscad , openjscad , on AWS ( pdf )
--
View this message in context: http://forum.openscad.org/Regarding-the-multiple-generator-expression-in-the-snapshot-2016-10-4-tp19098p19122.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
P
Parkinbot
Tue, Nov 15, 2016 10:07 PM
I see this more as typical library stuff. I would expect to find stuff like
that in lists.scad, but this file seems to be a bit left out in the cold.
BTW, I don't care about the parameter order, as long as I have the right
library included.
--
View this message in context: http://forum.openscad.org/Regarding-the-multiple-generator-expression-in-the-snapshot-2016-10-4-tp19098p19124.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
I see this more as typical library stuff. I would expect to find stuff like
that in lists.scad, but this file seems to be a bit left out in the cold.
BTW, I don't care about the parameter order, as long as I have the right
library included.
--
View this message in context: http://forum.openscad.org/Regarding-the-multiple-generator-expression-in-the-snapshot-2016-10-4-tp19098p19124.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Tue, Nov 15, 2016 11:42 PM
I agree with you. We need a standard lists.scad. I have mine, you have
yours, and there is many others out there.
Not all fundamental list processing functions need or should be built in.
Then... why not build a proposal to be standardize? Shall we start it in
github?
2016-11-15 20:07 GMT-02:00 Parkinbot rudolf@parkinbot.com:
I see this more as typical library stuff. I would expect to find stuff like
that in lists.scad, but this file seems to be a bit left out in the cold.
BTW, I don't care about the parameter order, as long as I have the right
library included.
I agree with you. We need a standard lists.scad. I have mine, you have
yours, and there is many others out there.
Not all fundamental list processing functions need or should be built in.
Then... why not build a proposal to be standardize? Shall we start it in
github?
2016-11-15 20:07 GMT-02:00 Parkinbot <rudolf@parkinbot.com>:
> I see this more as typical library stuff. I would expect to find stuff like
> that in lists.scad, but this file seems to be a bit left out in the cold.
>
> BTW, I don't care about the parameter order, as long as I have the right
> library included.
>
P
Parkinbot
Wed, Nov 16, 2016 12:18 AM
Then... why not build a proposal to be standardize? Shall we start it in
github?
Good idea. I don't have github account, but why not use yours? You have my
code already and we could collect and unify more existing code as well as
produce and test some more.
Good candidates would be:
- reverse(L)
- exchangeVal(L, n, m)
- subList(L, n, m)
- find(L, val)
- quickSort(L, ascending=true)
- insertInSortedList(L, val)
another theme would be to bring matrix related stuff into a standard
library.
The libraries that come along with OpenSCAD in the library folder don't seem
to address this, and are btw not very well maintained. I repeatedly
suggested to auto-include a standard library like standard.scad, which could
be customized to have other imported libs always included. This also aims at
the project initiative discussed in another thread.
I usually start my code with the line use <my.scad> which includes the
most important other stuff I need.
--
View this message in context: http://forum.openscad.org/Regarding-the-multiple-generator-expression-in-the-snapshot-2016-10-4-tp19098p19129.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Ronaldo wrote
> Then... why not build a proposal to be standardize? Shall we start it in
> github?
Good idea. I don't have github account, but why not use yours? You have my
code already and we could collect and unify more existing code as well as
produce and test some more.
Good candidates would be:
- reverse(L)
- exchangeVal(L, n, m)
- subList(L, n, m)
- find(L, val)
- quickSort(L, ascending=true)
- insertInSortedList(L, val)
another theme would be to bring matrix related stuff into a standard
library.
The libraries that come along with OpenSCAD in the library folder don't seem
to address this, and are btw not very well maintained. I repeatedly
suggested to auto-include a standard library like standard.scad, which could
be customized to have other imported libs always included. This also aims at
the project initiative discussed in another thread.
I usually start my code with the line *use <my.scad>* which includes the
most important other stuff I need.
--
View this message in context: http://forum.openscad.org/Regarding-the-multiple-generator-expression-in-the-snapshot-2016-10-4-tp19098p19129.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Wed, Nov 16, 2016 1:55 AM
Then... why not build a proposal to be standardize? Shall we start it in github?
Oskar started on some tools which I merge into scad-utils:
https://github.com/openscad/scad-utils
This really needs a champion who can define and QA the API, as any built-in functions need to be maintained in the future to ensure backwards compatibility.
There’s also “MCAD 2”, which is a rewrite/cleanup of MCAD, with partially overlapping goals with scad-utils.
..and runsun did some work a while back on documentation and testing of user-space code:
https://github.com/runsun/openscad_doctest
We’re aiming/hoping for a release end of this year. Any significant progress on a user-space API has a good change of making it into that release.
-Marius
On Nov 15, 2016, at 18:42, Ronaldo Persiano <rcmpersiano@gmail.com> wrote:
>
> Then... why not build a proposal to be standardize? Shall we start it in github?
>
Oskar started on some tools which I merge into scad-utils:
https://github.com/openscad/scad-utils
This really needs a champion who can define and QA the API, as any built-in functions need to be maintained in the future to ensure backwards compatibility.
There’s also “MCAD 2”, which is a rewrite/cleanup of MCAD, with partially overlapping goals with scad-utils.
..and runsun did some work a while back on documentation and testing of user-space code:
https://github.com/runsun/openscad_doctest
We’re aiming/hoping for a release end of this year. Any significant progress on a user-space API has a good change of making it into that release.
-Marius
RP
Ronaldo Persiano
Wed, Nov 16, 2016 1:55 AM
Ok, Rudolf. The repository is already created:
https://github.com/RonaldoCMP/OpenSCAD-standard-libs
In this repository I have included just the list.scad file for now.
Intentionally, I have not included all the codes you posted above and put
some of my own library.
Similarly, I have not standardized the function and variable naming.
I added a comment line or two per function.
The path is open. Start filling the file with your proposals.
2016-11-15 22:18 GMT-02:00 Parkinbot rudolf@parkinbot.com:
Then... why not build a proposal to be standardize? Shall we start it in
github?
Good idea. I don't have github account, but why not use yours? You have my
code already and we could collect and unify more existing code as well as
produce and test some more.
Ok, Rudolf. The repository is already created:
https://github.com/RonaldoCMP/OpenSCAD-standard-libs
In this repository I have included just the list.scad file for now.
Intentionally, I have not included all the codes you posted above and put
some of my own library.
Similarly, I have not standardized the function and variable naming.
I added a comment line or two per function.
The path is open. Start filling the file with your proposals.
2016-11-15 22:18 GMT-02:00 Parkinbot <rudolf@parkinbot.com>:
> Ronaldo wrote
> > Then... why not build a proposal to be standardize? Shall we start it in
> > github?
>
> Good idea. I don't have github account, but why not use yours? You have my
> code already and we could collect and unify more existing code as well as
> produce and test some more.
>
>
>
TP
Torsten Paul
Wed, Nov 16, 2016 2:08 AM
On 11/16/2016 02:55 AM, Marius Kintel wrote:
Hmm, we still lack a license for that repo. Did Oskar state
anything about that in some forum post maybe?
ciao,
Torsten.
On 11/16/2016 02:55 AM, Marius Kintel wrote:
> Oskar started on some tools which I merge into scad-utils:
> https://github.com/openscad/scad-utils
>
Hmm, we still lack a license for that repo. Did Oskar state
anything about that in some forum post maybe?
ciao,
Torsten.
MK
Marius Kintel
Wed, Nov 16, 2016 2:33 AM
On Nov 15, 2016, at 21:08, Torsten Paul Torsten.Paul@gmx.de wrote:
On 11/16/2016 02:55 AM, Marius Kintel wrote:
Hmm, we still lack a license for that repo. Did Oskar state
anything about that in some forum post maybe?
The first few commits were explicitly BSD. I guess we’ll have to ping him..
-Marius
> On Nov 15, 2016, at 21:08, Torsten Paul <Torsten.Paul@gmx.de> wrote:
>
> On 11/16/2016 02:55 AM, Marius Kintel wrote:
>> Oskar started on some tools which I merge into scad-utils:
>> https://github.com/openscad/scad-utils
>>
> Hmm, we still lack a license for that repo. Did Oskar state
> anything about that in some forum post maybe?
>
The first few commits were explicitly BSD. I guess we’ll have to ping him..
-Marius
TP
Torsten Paul
Wed, Nov 16, 2016 3:40 AM
On 11/16/2016 03:33 AM, Marius Kintel wrote:
On Nov 15, 2016, at 21:08, Torsten Paul Torsten.Paul@gmx.de wrote:
Hmm, we still lack a license for that repo. Did Oskar state
anything about that in some forum post maybe?
The first few commits were explicitly BSD. I guess we’ll have
to ping him..
Ok, I've created an issue in the original repo, hopefully
he'll respond to that...
ciao,
Torsten.
On 11/16/2016 03:33 AM, Marius Kintel wrote:
>> On Nov 15, 2016, at 21:08, Torsten Paul <Torsten.Paul@gmx.de> wrote:
>> Hmm, we still lack a license for that repo. Did Oskar state
>> anything about that in some forum post maybe?
>>
> The first few commits were explicitly BSD. I guess we’ll have
> to ping him..
>
Ok, I've created an issue in the original repo, hopefully
he'll respond to that...
ciao,
Torsten.