|
Pages: [1]
|
 |
|
Author
|
Topic: REBOL Toolkit, Wants and Needs (Read 212 times)
|
|
btiffin
|
Hello,
I'd like to start a discussion about the small bits of infrastructure code that rebols spend time working on. By infrastructure I mean support words, such as a zero-pad numeric output, or a function generator that supports statics, or include, or series manipulators, or test heads or doc string scanners or little editors, or parse generators, or xml parsers, or etc...
Before (or in, or after) an application layer; how much time do you spend writing utility words that support that development?
What utility functions do you cut'n'paste or rewrite from application to application?
Besides the app layer; how many lines of code are support (% relative to app)?
Do you feel you get good bang for the buck with helper functions relative to getting an application finished? This is more of a general emotional question; Yes every time I write a new utility I save bags of future, relish it. Just need them to progress, here nor there or hmm, it always seems like a hinderance and I wish I didn't have to do it.
Thanks everyone, Brian Secretary; user.r, the International REBOL User Association
|
|
|
|
|
Logged
|
|
|
|
|
fhein
|
I haven't written alot of Rebol programs yet, so most support functions are only used once or twice. Here's my support functions, that I probably will reuse, so far: zero-pad, as you mentioned, to pad a value with zeroes (or any other char with refinement) to a specified length. attach. Like join, but tries to add stuff to anything - usually words or numbers. Returns the same datatype as input value was. form-with. The opposite of "parse/all data separator".. Ie it forms a string from a series! and putting the given separator between all the items. For example with "/" to reconstruct paths. cleaner-path. Like clean-path but modified to handle urls. try-save. Saves some data with a given filename. If that file already exists, it checks if they're identical and no save is needed. If they're different it will try to save the file with (2) added before the prefix, then (3) and so on until successful or a maximum is reached. levendist. Probably won't be reused alot, but it calculates the Levenshtein distance between two series. Sometimes it can be useful to see if two strings are almost the same. Refinements allow specification of cost for insert, reduce and a function that calculates the cost for translating a character to another. I'm guessing less than 5% is support code, probably closer to 1%. I find that most functions I need are already in Rebol 
|
|
|
|
|
Logged
|
|
|
|
|
btiffin
|
Utilities I end up writing over and over zero-pad (especially for date / time) format-date. Now I drag a modified R3 format around from script to script. Or for personal stuff, I user Chris Ross-Gill's form-date.r out of rebol.org. when value [some code] ; if symbol has a value, evaluate the code. when testing [...] trap [some code] [error] [no-error] error trap wrappers of various flavours Ladislav Mecir's include and lfunc. include cause it's handy, lfunc for generating functions that have static vars. Always questing for a console line editor. Nice to be in REBOL, make a change, redo, without leaving REBOL to go into an editor mind set. Always questing for shortcuts getting RebGUI form data into RebDB databases. And I find that I relish it sometimes and find it a hinderance other times. I think it depends on how rushed I feel getting the app done. Sidetrips are only fun when I feel I can afford the time and mental interruption. I spend far too much time scanning the web for existing solutions currently, I'd like to see that streamlined, umm now that I feel I've progressed past the "WTF?" stage of the REBOL learning curve. Before it was fun exploring and discovering, not so much now. Cheers, Brian fhien; Would you share your levendist? Mine sucks and performance is not good for bulk word analysis. 
|
|
|
|
|
Logged
|
|
|
|
|
fhein
|
Ofcourse, but it's probably not any faster than yours (I only use it to check 1 to 5 words when a button is pressed). It'll probably be a little speedier if you remove the replacement cost function stuff, and I'm sure there are other optimizations too. http://www.reboltalk.com/forum/index.php/topic,1511.0.html
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |
News: 01-09-08 Alpha version of REBOL 3 has been released!
2190 Posts in 579 Topics by 1632 Members
Latest Member: Apodeptackked
|