tag:blogger.com,1999:blog-30540442.post115888980435072505..comments2006-12-04T10:12:49.284-05:00Comments on 7ransCode: I No Longer Believe In Methodstea42http://www.blogger.com/profile/02848516783203845093noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-30540442.post-1159040950925167822006-09-23T15:49:00.000-04:002006-09-23T15:49:00.000-04:00this is a far different thing than saying that the...<I>this is a far different thing than saying that the concept of method is superfluous, and that you need not believe in it, believing only in objects.</I><BR/><BR/>Okay. It just terminological then. What I mean is simply this: if a procedure isn't 1st class then it isn't a method. Now obviously one can argue with my definition of method, but understand that I am making it from a pure OOPL point of view. The upshot of course is that when I say by "I no longer beleive in methods" I mean that I no longer beleive in Ruby's "methods" b/c they aren't methods, rather they are just procedures.<BR/><BR/>Thanks for the feedback!tea42https://www.blogger.com/profile/02848516783203845093noreply@blogger.comtag:blogger.com,1999:blog-30540442.post-1158961689628043742006-09-22T17:48:00.000-04:002006-09-22T17:48:00.000-04:00what does "methods as first class objects" mean? t...what does "methods as first class objects" mean? <BR/><BR/>that you can treat a method as an object?<BR/><BR/>yes, this is obviously possible.<BR/><BR/>that you can unify the notion of object and method into a single uniform entity?<BR/><BR/>no, i do not believe there is any reasonable semantics for this.<BR/><BR/>in io anonymous methods and blogs are first class, but they are not objects. stack frames however are, which is a rather interesting possibility.<BR/><BR/>"Are you saying that it is not truly possible to have methods as 1st class objects? Despite my hyperbole, in short, that's all I'm really suggesting."<BR/><BR/>i think you're confounding two uses of 'object'. one to mean object as in the thing that has slots/methods/etc, and the other to mean "entity of the language semantics". if you rewrite your statement to say that methods can be first class values of the language, I would agree. this is a far different thing than saying that the concept of method is superfluous, and that you need not believe in it, believing only in objects.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-30540442.post-1158948884292358072006-09-22T14:14:00.000-04:002006-09-22T14:14:00.000-04:00i'm calling your example a strawman because you've...<I>i'm calling your example a strawman because you've merely provided syntax with the assumption that a reasonable semantics for it exists. if you work the semantics out explicitly, i think you'll find you need to separate the concepts of object and method.</I><BR/><BR/>Are you saying that it is not truly possible to have methods as 1st class objects? Despite my hyperbole, in short, that's all I'm really suggesting.tea42https://www.blogger.com/profile/02848516783203845093noreply@blogger.comtag:blogger.com,1999:blog-30540442.post-1158948441973230052006-09-22T14:07:00.000-04:002006-09-22T14:07:00.000-04:00Hi jacob. Well "procedural" would be okay. I reall...Hi jacob. Well "procedural" would be okay. I really just mean non-OOP. People tend to associate Ruby to Smalltalk when it comes to it's OOP charateristics and Lisp otherwise. So I choose the term "functional" for that reason. And don't get me wrong I'm not implying anything against functional langauges. I love Lisp!tea42https://www.blogger.com/profile/02848516783203845093noreply@blogger.comtag:blogger.com,1999:blog-30540442.post-1158946469058224172006-09-22T13:34:00.000-04:002006-09-22T13:34:00.000-04:00You should look at Io. _Everything_ is an object, ...You should look at Io. _Everything_ is an object, for real. It doesn't even have keywords.<BR/><BR/>http://www.iolanguage.com/about/faq/<BR/><BR/>From the manual:<BR/><BR/>"Io’s guiding design principle is simplicity and power through conceptual unification. <BR/><BR/>In Io, everything is an object (including the locals storage of a block and the namespace itself) and all actions are messages (including assignment). Objects are composed of a list of key/value pairs called slots, and an internal list of objects from which it inherits called protos. A slot’s key is a symbol (a unique immutable sequence) and it’s value can be any type of object."Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-30540442.post-1158946222262402152006-09-22T13:30:00.000-04:002006-09-22T13:30:00.000-04:00we will simply have to disagree. your definition o...we will simply have to disagree. your definition of object is broad enough to lose it's utility.<BR/><BR/>lisp was based on a misunderstanding of lambda calculus. these issues were later (mostly) corrected, tho impure features remain as they're considered useful. <BR/><BR/>i believe you are similar misunderstanding OO. there are several formalisms for OO available. each are largely equivalent, though i believe abadi and cardelli's is most convenient. read http://lucacardelli.name/Papers/PrimObj1stOrder.pdf for an introduction.<BR/><BR/>i'm calling your example a strawman because you've merely provided syntax with the assumption that a reasonable semantics for it exists. if you work the semantics out explicitly, i think you'll find you need to separate the concepts of object and method.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-30540442.post-1158939428921820612006-09-22T11:37:00.000-04:002006-09-22T11:37:00.000-04:00You need to be careful of your usage of the term "...You need to be careful of your usage of the term "functional". E.g.:<BR/><BR/><I><BR/>... the whole "special needs" arises out of the fact that Ruby is, in this respect at least, still a functional lanaguage and not a true OOPL.<BR/></I><BR/><BR/>I have a feeling you mean "procedural" here. The term "functional language" is a very well accepted term for languages whose entire semantic is based on composition of "functions" (aka lambdas), such as Lisp, Scheme, OCaml, etc. "Procedural languages", on the other hand, are languages where the semantic is based on the imperative execution of subroutines ("procedures").<BR/><BR/>And I don't think many in the "true" functional languages camp would be too happy with the characterization that functional languages fall short of OOP languages, if that's what you really meant. :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-30540442.post-1158907088008575442006-09-22T02:38:00.000-04:002006-09-22T02:38:00.000-04:00Yes, Ruby is an OOPL, but I am arguing that it lac...Yes, Ruby is an OOPL, but I am arguing that it lacks an OOPL characteristic. Just like Lisp is a functional language but is not considerd pure. Things admit of degrees.<BR/><BR/>Every object is different from every other object, yet they are still objects. Thus a method can be different but also be an object. The "semantic" is already defined. They are called "methods as 1st class objects." It's been done... it's being done. Consider, the heart of all computer code is simply number as symbolic representation. The computer cannot, on its own, distinguish between operator and operand.<BR/><BR/>As for my "strawman" example, it is in fact the simplification of very real code.tea42https://www.blogger.com/profile/02848516783203845093noreply@blogger.comtag:blogger.com,1999:blog-30540442.post-1158902047143728722006-09-22T01:14:00.000-04:002006-09-22T01:14:00.000-04:00it's polymorphism over self that defines OO langua...it's polymorphism over self that defines OO languages. ruby certainly qualifies.<BR/><BR/>methods are and should be a concept orthogonal to objects. this is because objects are a labeled set of methods. if we state that methods are also objects, we arrive at an empty recursive definition. we also completely fail to capture the actual behavior of methods, which is term rewriting under substitution of self and the formal parameters of an invocation.<BR/><BR/>read abadi and cardelli's Theory of Objects for in depth discussion.<BR/><BR/>it's obvious that even in your example, methods are something different than objects, though you're having them syntactically masquerade as objects to store some properties. <BR/><BR/>can you take your strawman example and define a semantics that makes sense for an entire language? what does that look like? i think you'll find it instructive.Anonymousnoreply@blogger.com