Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Compare lambda expressions pointers by value

Hendrik M Halkow:

Consider the following Python program:


a = lambda x: x
b = lambda x: x
print(a == b)

This obviously outputs False although, which is clear why it happens. However, this is counterintuitive. I wonder if there is any programming language (not academic-only) that is able to do a structural comparison of lambda expressions and would print True in the example above? If this doesn't work out of the box, is there any smart way to compare lambda expressions at all? How about the .NET abstract syntax trees?



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Compare lambda expressions pointers by value

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×