[Om] Named functions in OpenMath

James Davenport J.H.Davenport at bath.ac.uk
Mon May 4 11:45:16 CEST 2015


I am not sure that I am familiar enough with Popcorn to understand the  
details, but I'll try.
What you seem to want is a context in which 'area' is fns1.lambda[$a,  
$b -> $a * $b].
This is, I claim, conceptually no different from a context in which  
'area' is 42.
An old-fashioned function programmer might apply fns1.lambda[$area ->  
context] and apply it to 42 (or fns1.lambda[$a, $b -> $a * $b]) , but  
this is ratehr in need to syntactic sugar.
Have you looked at the prog1 CD, which might be what you want.
James
Quoting "Wenzel, Ken" <Ken.Wenzel at iwu.fraunhofer.de>:

> Hello,
>
> I wonder what is the correct way to represent a named function in OpenMath.
>
> For example, I like to describe a function named "area" that computes the
> area of a rectangle.
>
> The corresponding Popcorn expression for the anonymous function is:
>
> fns1.lambda[$a, $b -> $a * $b]
>
> What is now the correct method to name this function.
>
> I can, for example, just give it an ID like
>
> fns1.lambda[$a, $b -> $a * $b] : area
>
> and invoke it with #area(3, 4) at an later point.
>
> But I think this is some kind of structure sharing since the lambda  
> expression is
> simply copied into the resulting OpenMath object and not the invocation of
> a single function named "area".
>
> I would be grateful if somebody can help me.
>
> Best regards,
> Ken
> _______________________________________________
> Om mailing list
> Om at openmath.org
> http://openmath.org/mailman/listinfo/om



James Davenport
National Teaching Fellow 2014
Hebron & Medlock Professor of Information Technology, University of Bath
OpenMath Content Dictionary Editor
Director of Studies EPSRC Doctoral Taught Course Centre for HPC
Chair, IMU Committee on Electronic Information and Communication
Vice-President and Academy Trustee, British Computer Society
SW Coordinator, Computing at School Network of Excellence



More information about the Om mailing list