X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01 Apr 2022 04:20 PM by  Evan Fishbein
lamda's as elements of a dictionaries
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Evan Fishbein



New Member


Posts:1
New Member


--
01 Apr 2022 04:20 PM
    This code simplifies the situation:
    compile_opt strictarr
    ec=hash()
    ec =dictionary('l', lambda('x:x^2') )
    a={a:lambda('x:x^2')}

    scr=ec['l']
    scr1=a.a
    print, scr(1), scr1(1)

    What is the syntax for accessing the lambda expression without the dummy variables scr and scr1. For example
    ec.l(1), (ec.l)(1), ((ec.1))(1) all return "undefined method for dictionary" or "syntax errors."
    You are not authorized to post a reply.