lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Dec 18, 2012 at 2:14 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> Actually, on second thoughts, anything short of an array
> with vector semantics will be disappointing.

I've recently been using such a numerical array and it is a useful
beast.Still feel that it is a subtype, since not every element type
has the necessary operations. But maybe this is residual static-typing
anxiety.. As in all dynamic languages can use the Caveat Emptor
principle; if you get an error with a+b then it's your own fault for
not having add-able elements.

> {1,2,3}*{4,5,6} -- to be debated, {4,10,18} or 32 or error

I vote for the first one; dot-product can be a method. (Cross-product
is a rather more specialized kind of animal)

I'd think we agree that a1 .. a2 is the combined array and not
element-wise concatenation!  One might wish however that something
like A{'help','interp','foo'}..'.lua' would be
A{'help.lua','interp.lua','foo.lua'}.

steve d.