However, I honestly don't think this is a useful or general enough function to go in arc.arc, especially as we already have 'fill-table, 'listtab, etc.
As for "creating a named table", er:
(= foo (table)) ; I'm unclear on what's difficult about creating a table.
I think the difficult part is passing in an arbitrary name to a function, for which the tables 'name' becomes set to, but I am just guessing that's what he wants...
and I agree I don't see a whole lot of need for the function to be part of the arc release..., since there are probably better ways to accomplish the same end result.... a good example of which is news.arc's storage of story records.
I think the difficult part is passing in an arbitrary name to a function, for which the tables 'name' becomes set to, but I am just guessing that's what he wants...
I rather doubt that's the issue, as it's easy to do with a macro.
arc> (mac filltbl (tbl keys vals)
`(= ,tbl (fill-table (table) (mappend list ,keys ,vals))))
#3(tagged mac #<procedure: filltbl>)
arc> (filltbl blah '(a b c) '(1 2 3))
#hash((c . 3) (a . 1) (b . 2))
arc> blah
#hash((c . 3) (a . 1) (b . 2))
I think it's just a request for a convenience function to zip together a list of keys with a list of values into a table, since the existing methods for creating tables center around having alternating key/value pairs.
I'm not sure how any of these can work for intializing a table that's not aleady a table...
(= k* '("1" "2" "3"))
(= v* '("One" "Two" "Three"))
assuming t* has not been set - this is what I get:
arc> (filltbl t* k* v*)
Error: "reference to undefined identifier: _t*"
or even:
arc> (filltbl 't* k* v*)
Error: "Can't set reference t* \"1\" \"One\""
so what am I missing ?
filltbl isn't a macro, nor does it affect the global namespace. As written, it just creates a table if its first arg is nil. Of course, this is useless unless it returns that table... oops.
You could push it onto Anarki. Other than that, there isn't much you can do to get it into a public arc.arc. It seems that if a function isn't used in the forum code, pg doesn't include it in the official release.
I read somewhere that rtm created the first worm ?
I think that qualifies him for super spy hacker status. Certainly would meet the "colorful" criteria as suggested in the article.
I think rtm should apply and make arc the flagship tool....