Date: Fri, 21 Jan 1994 12:06:46 +0100 From: Steve Linton <firstname.lastname@example.org> Message-ID: <email@example.com> To: GAP Forum <GAP-Forum@Math.RWTH-Aachen.DE> In-Reply-To: <a@b> Subject: Re: [no subject]
LISP 'apply function:
Since LISP seems to have been an influence in the design of the GAP
language, I wondering whether there might be a (hidden?) function
equivalent to the LISP 'apply function. This function takes as arguments
a function F and a list L and its evaluation is equivalent to a call to F
with arguments given by the elements of L.
i.e. ApplyFunction(F,[a,b,c]) is equivalent to F(a,b,c)
Hear, hear. I have wanted this too and it must be easy to implement.
Any chance of including a non-recursive PrintRec in future? When trying
to find out what the fields of a record are there can be an *enormous*
amount of output to wade through (try a GroupHomormorphismByImages
Do you know about RecFields?
> Matrix calculations:
> I need to calculate a number of products of some matrices and add these
> products together. What is the best way of doing this? The simplest
> method, Sum([1..n], i -> A[i]*B[i]), uses much more space than necessary.
> It should be possible to do all this using only two extra matrices, one
> to accumulate the sum, the other to store each product. Can this be done?
Trivial with a loop, but Sum ought to get this right as well.
ie Sum(l,f) should be more efficient than Sum(List(l,f))