comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » lambda function syntax
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
lambda function syntax [message #92249] Thu, 05 November 2015 06:36 Go to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
I've created a lambda procedure inside an object (to hold a user-defined function):

self.lambda=lambdap("t,n1:"+code)

where, e.g. code="n1=sqrt(t)"

This appears to work fine, but I can't figure out a legal syntax to call it inside a method:


function test_obj::N1,t
self.n1_lambda,t,n1
return,n1
end


IDL> print,obj->n1(1)
% Attempt to call undefined method: 'TEST_OBJ::N1_LAMBDA'.

---

Having written the example, I discovered it does work if I do this:

function test_obj::N1,t
lam=self.n1_lambda
lam,t,n1
return,n1
end

which isn't so bad. The first should be correct syntax, though, I think.

cheers,
Greg
[Message index]
 
Read Message
Read Message
Previous Topic: errors in robust_linefit
Next Topic: EXIT from within an application

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:29:54 PDT 2025

Total time taken to generate the page: 0.00525 seconds