[q-lang-users] Two proposed improvements to Q
Brought to you by:
agraef
From: John C. <co...@cc...> - 2007-06-27 17:04:00
|
These are some changes I thought up while reviewing Q in a Nutshell. 1) Q currently can't import names selectively from a module. I propose the Python syntax for this: from <module> import <name>,<name>,...; and a variant that exports as well as importing: from <module> import <name>,<name>,...; and a variant that exports as well as importing: from <module> include <name>,<name>,...; This makes "from" a reserved word, but I think that is a small price to pay for the added convenience of being able to bring in specified names only without the risk of unintended namespace pollution. 2) Now that Q has ML-style reference cells (which are not documented anywhere in the Q manual that I can see), adding general mutable (but fixed-length) vectors is an easy extension: one simply adds a few equations to the standard library for treating tuples of cells properly. Following that, byte vectors (mutable byte strings) would also be a useful addition for dealing with large quantities of homogeneous data; these have to be done in C, but would be far more efficient than any alternative representation. -- Is not a patron, my Lord [Chesterfield], John Cowan one who looks with unconcern on a man http://www.ccil.org/~cowan struggling for life in the water, and when co...@cc... he has reached ground encumbers him with help? --Samuel Johnson |