1. Function recommendations for Standard Library?
- Posted by Jeremy Cowgar <jeremy at c?wga?.com> Apr 28, 2008
- 934 views
Please read this whole message before creating any response. Thank You. I am asking for function recommendations that you think should be added to the standard library. Please, do not debate if they should be added or not in this thread. If someone suggests function ABCDEF() and you do not think it should be part of the standard library, please, start a new thread titled: "Include function ABCDEF() in standard library?"... pretty please? Here are a few rules I setup for determining if something should be included in the standard library. Again, if you think a rule is incorrect or a new rule should be added, pretty please create a new thread, do not post in this thread. Rules: 1. Must be of general and popular use. 2. Must not rely on 3rd party installs. 3. Must be cross-platform *or* platform dependent. 4. Doesn't have multiple ways of doing the same thing w/varying benefit 5. Must not be overly complex Ok, I'll explain these rules a bit. 1. Must be of general and popular use ===================================== It must be a general function. For instance, atan2. That is not specific to my program. It must be a popular function. I have an extract that tears apart an EDI file. This can be applied to other applications but the percentage of Euphoria programmers who deal with EDI files is probably very low, therefore, it is not a candidate for inclusion in the general library. 2. Must not rely on 3rd part installs ===================================== The general library should contain functions that are available on *all* installations of Euphoria. Function ABC should not be available on John's because he happens to have program DEF installed, but not on Jane's because she does not have program DEF. If it's in the standard library, it should work. 3. Must be cross-platform *or* platform dependent ================================================= This sounds like an oxy-moron at first glance but what it means is, if Windows and Linux/FreeBSD are both capable of doing the task the function provides, then the function must work on both Windows and Linux/FreeBSD. If the function provides a task that is not available on both platforms, for instance, reading and writing to the Windows registry, than this rule does not dis-qualify that type of routine from being included. Just because Euphoria is cross-platform does not mean that we should limit functions to only the common attributes of all platforms. Now, another example may be tcp/ip sockets. TCP/IP sockets are capable on both Windows and Linux/FreeBSD. Therefore, if any standard socket library is accepted into the standard library, it *must* work on both Windows and Linux/FreeBSD platforms. 4. Doesn't have multiple ways of doing the same thing w/varying benefit ======================================================================= An example (I know this example conflicts w/point #2, but, it's an example): A GUI framework. There is Win32Lib, Arwen, wxWidgets, GTK, X/WMOTOR, Iup, and others. Each have their own pro's and con's. The user/programmer should decide which is best for him/her. 5. Must not be overly complex ============================= By adopting code into the standard library, the Euphoria developers are taking on the role of bug fixes and maintenance. We hope that users will create patches, bug fixes, performance enhancements, etc... but by becoming part of the standard library, there is an increase of responsibility for the Euphoria developers. There may be a really handy function but to implement it takes 2,000 lines of code. This would be cause to not include it in the standard library. ====================================== Please, if you would like to see something in the standard library, reply to this message. It can be a function you wrote, something in the archive, or even something you would like to do but have no code to do it (in that case, it would be nice if you would write the code and submit ) Also, a note. Just because something is suggested here does not mean it will be included. I am just querying the Euphoria public now. If it meets the above, then chances are it will be included. Not all functions that have been added have been documented yet, but, they are all listed in the release notes. I have made this (and documentation generated from the SVN copy of Euphoria) available on my personal website: http://jeremy.cowgar.com/euphoria/relnotes.html http://jeremy.cowgar.com/euphoria/library.html Please note, as always when I post this URL, these documents are TEMPORARY, they will be removed once 3.2/4.0 is released. They are NOT official and the documentation you see in them may/PROBABLY will change. It IS the documentation off a SVN TRUNK, therefore, in high development. Thank you -- Jeremy Cowgar http://jeremy.cowgar.com
2. Re: Function recommendations for Standard Library?
- Posted by ChrisBurch2 <crylex at fr??uk.co.uk> Apr 28, 2008
- 884 views
- Last edited Apr 29, 2008
Here's a list for you http://www.utas.edu.au/infosys/info/documentation/C/CStdLib.html Chris
3. Re: Function recommendations for Standard Library?
- Posted by Jeremy Cowgar <jeremy at cow?ar.co?> Apr 28, 2008
- 892 views
- Last edited Apr 29, 2008
ChrisBurch2 wrote: > > Here's a list for you > > <a > href="http://www.utas.edu.au/infosys/info/documentation/C/CStdLib.html">http://www.utas.edu.au/infosys/info/documentation/C/CStdLib.html</a> > I glanced through the list rather quickly and I believe we have all the pertinent ones. sinh, tanh and cosh I do not think we have. Were there others in that list that you feel should be part of the stdlib? -- Jeremy Cowgar http://jeremy.cowgar.com
4. Re: Function recommendations for Standard Library?
- Posted by Larry Miller <larrymiller at sask?el.?et> Apr 28, 2008
- 897 views
- Last edited Apr 29, 2008
Here are 4 functions for consideration for inclusion in the standard library. They are rfind(), rfind_from(), rmatch(), rmatch_from(). They perform the same functions as find(), find_from(), match(), match_from() but in reverse order. They also have similar error messages.
--Find x as an element of s starting from index start going down to 1 --If start<1 then it is an offset from the end of s global function rfind_from(object x, sequence s, integer start) integer len len=length(s) if (start > len) or (len + start < 1) then printf(1,"third argument of rfind_from() is out of bounds (%d)",start) ?1/0 end if if start < 1 then start = len + start end if for i = start to 1 by -1 do if equal(s[i], x) then return i end if end for return 0 end function global function rfind(object x, sequence s) return rfind_from(x, s, length(s)) end function --Try to match x against some slice of s, starting from index start and going down to 1 --if start<0 then it is an offset from the end of s global function rmatch_from(sequence x, sequence s, integer start) integer len,lenx len = length(s) lenx = length(x) if lenx = 0 then puts(1, "first argument of rmatch_from() must be a non-empty sequence") ?1/0 elsif (start > len) or (len + start < 1) then printf(1, "third argument of rmatch_from is out of bounds (%d)",start) ?1/0 end if if start < 1 then start = len + start end if if start + lenx - 1 > len then start = len - lenx + 1 end if lenx-= 1 for i=start to 1 by -1 do if equal(x, s[i..i + lenx]) then return i end if end for return 0 end function global function rmatch(sequence x, sequence s) if length(x)=0 then puts(1,"first argument of rmatch_from() must be a non-empty string") ?1/0 end if return rmatch_from(x, s, length(s)) end function
Larry Miller
5. Re: Function recommendations for Standard Library?
- Posted by ChrisBurch2 <crylex at f?eeuk?co.uk> Apr 28, 2008
- 902 views
- Last edited Apr 29, 2008
Hi C has had a standard lib for - a long time. It has probably evolved to the level where 'most' users are able to find 'most' of what they need within that with a structure that would seem to be intuitive to them. As has been suggested, I probably won't use most of the functions there, but it would certainly be a good starting point for a template for a pretty complete eu stdlib. You could go on adding functions to a new stdlib, but you've got to call a halt somewhere. Again, the C stdlib provides a good framework. Keep up the good work. Chris
6. Re: Function recommendations for Standard Library?
- Posted by Jeremy Cowgar <jeremy at cow?a?.com> Apr 29, 2008
- 908 views
Larry Miller wrote: > > Here are 4 functions for consideration for inclusion in the standard library. > They are rfind(), rfind_from(), rmatch(), rmatch_from(). > They perform the same functions as find(), find_from(), match(), match_from() > but in reverse order. They also have similar error messages. Larry, Thanks! I've added them to the library. I am hoping to find a better means, if not create one, to trigger an error. Please see my message: http://www.openeuphoria.org/EUforum/m20167.html -- Jeremy Cowgar http://jeremy.cowgar.com
7. Re: Function recommendations for Standard Library?
- Posted by CChris <christian.cuvier at agriculture.gouv?f?> Apr 29, 2008
- 922 views
Jeremy Cowgar wrote: > > Larry Miller wrote: > > > > Here are 4 functions for consideration for inclusion in the standard > > library. > > They are rfind(), rfind_from(), rmatch(), rmatch_from(). > > They perform the same functions as find(), find_from(), match(), > > match_from() > > but in reverse order. They also have similar error messages. > > Larry, > > Thanks! I've added them to the library. I am hoping to find a better means, > if not create one, to trigger an error. Please see my message: > > <a > href="http://www.openeuphoria.org/EUforum/m20167.html">http://www.openeuphoria.org/EUforum/m20167.html</a> > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> After the print(1,"Bad stuff"), simply add ?machinr_func(26,0) so that GUI users are aware of the message. Or you could even include this:
global procedure pause(integer device,sequence message) integer n puts(device,message) n=machine_func(26,0) end procedure
CChris