You're viewing a comment by Will and its responses.

August 07, 2011, 04:24

No what?

No there's not a way to use functors in Prolog that is comparable to their usage in ML? That would be sad.

No functors aren't equivalent in all three mentioned programming languages, ignoring mutability concerns? Well, maybe Haskell enforces some extra constraints, but there's no reason you couldn't conform if you actually needed the mathematical properties that entails.

Comment Responses

December 27, 2011, 19:25

I think you've misunderstood.

Peter's post was about how four different languages have things they call 'functor' that are completely different. He then went on to explain them. None of the things called 'functor' in the post are related except in that they share the same name. 'Functor' is one of these things that, in computing has radically different meanings depending on context.

Back to Prolog though. Prolog has things called 'atom', essentially symbolic identifiers. Prolog allows you to specify the relationship between various atoms, thus the term 'foo(bar, baz)' states that atoms 'bar' and 'baz' have a relationship symbolised by the atom 'foo'. Prolog calls the atom in a term that symbolises the relationship between its arguments the 'functor', though something like 'predicate' would likely have been a less confusing choice.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "network_219": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.