> < ^ Date: Tue, 11 Jun 2002 21:34:24 +0100
> < ^ From: Steve Linton <sal@dcs.st-and.ac.uk >
< ^ Subject: Re: functions that return functions

Dear GAP Forum,

Markus Pueschel asked:

pueschel@ece.cmu.edu said:
> I have the following problem:
> gap> f := i -> (j -> j + i); function ( i ) ... end gap> Print(f(4));
> function ( j )
>     return j + i;

I didn't really expect that gap would print
function ( j )
return j + 4;
but still would like to find a way to do it.
(i.e., how do I access the "context" of f(4)?)

I am afraid this information is not accessible from the GAP level.
If you are interested, I can explain to you off-line
how this link is maintained in the kernel, and how you might set about writing
kernel functions to access it if you really wanted to, but it is, to put it
mildly, rather technical.

Steve

-- 
Steve Linton	School of Computer Science  &
      Centre for Interdisciplinary Research in Computational Algebra
	     University of St Andrews 	 Tel   +44 (1334) 463269
http://www-theory.dcs.st-and.ac.uk/~sal	 Fax   +44 (1334) 463278   

> < [top]