Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's a useless distinction. Everything is an object in Python. Does that mean Python doesn't have values?


It has primitive values:

(0) small enough numbers

(1) True, False, None, etc.

(2) object references

But it doesn't have compound values.

And the distinction isn't useless. Values have a richer equational theory than objects, enabling lots of automatic optimizations.


...And outside FP, nobody cares, or uses that definition of value. As noted in my above post.


It's useful when writing Prolog programs too.


Logic programming's actually pretty close to FP.


Not really. Prolog is first-order. Functional languages, just like object-oriented ones, are higher-order.


"Close," not "is."


[flagged]


Don't mock me. And yes, I did mean the notion of mathematical value and variable. That's one of the core tenets of both.


[flagged]


They are somewhat close in paradigm: They both favor declarativism, and have mathematical values. Given, they're pretty far apart in paradigm, but those are some strong similarities.


> declarativism

I'm not familiar with that term. Could you give a rigorous definition?

Anyway, after some googling, I found a very plausible definition that makes functional programming not a declarative paradigm: http://semantic-domain.blogspot.com/2013/07/what-declarative...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: