From: Reuben T. <rr...@sc...> - 2004-02-01 19:04:04
|
I have just committed some changes provoked by Jamie Webb's submission of his std.lua library, which was mostly aimed at core functionality (manipulation of arrays, sets, tables and functions). So far I have incorporated all the stuff which matched existing functions. I've also removed some functions (from my stuff) that didn't look that useful and made other miscellaneous fixes and improvements that occurred to me as I read through the code. I'm left mostly with the functions that don't match anything I have, which I'll divide into groups: those I have no problems with and will go ahead and add later, those I don't think are necessary, and those I don't know what to do with: The following are fine: function std.succ(x) function std.generate(f, start, length) function std.deep_copy(t) (but what to call it and shallow_copy?) function std.intersect(a, b) -- I'll reimplement my set module function std.difference(a, b) -- with these in mind, probably -- getting rid of my set type The following look good but I'm not sure how best to handle them: function std.dump(value, key, fh, depth, pr, done) -- better done -- by reimplementing my tostring using a visitor and then -- reusing the visitor for dump the functionalised operators +, -, .. &c. -- not sure how best to -- include these, e.g. how to name them, how general they -- really should be (arity &c.) The following I plain don't understand: function std.getter(name) -- what's this for? function std.method(name, ...) -- what's this for? function std.bind_method(t, m) -- what's this for? I'm dubious about the following: function std.map_tbl(f, t) -- it is really wise to map over a table? function std.filter_tbl(f, t) -- these should only be used on lists/arrays IMO function std.conjunction(...) -- this seems a bit specialised; it's really reverseMap composed with functionalised "and" -- http://www.mupsych.org/~rrt/ | perfect, a. unsatirizable |