From ruby-talk-admin@ruby-lang.org Fri Dec 16 02:44:30 2005 Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (8.12.3/8.12.3/Debian-6.6) with ESMTP id jBFHiUZk029990; Fri, 16 Dec 2005 02:44:30 +0900 Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 806175A68; Fri, 16 Dec 2005 02:44:35 +0900 (JST) Received: from localhost (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 916C9F0486B; Fri, 16 Dec 2005 02:44:35 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 59CB4F04866; Fri, 16 Dec 2005 02:44:34 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [210.163.138.100]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 594EC63002B; Fri, 16 Dec 2005 02:44:34 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [127.0.0.1]) by beryllium.ruby-lang.org (Postfix) with ESMTP id 66CE433E86; Fri, 16 Dec 2005 02:44:08 +0900 (JST) Received: from localhost (beryllium.ruby-lang.org [127.0.0.1]) by beryllium.ruby-lang.org (Postfix) with ESMTP id A3B9D33E08 for ; Fri, 16 Dec 2005 02:43:59 +0900 (JST) Received: from beryllium.ruby-lang.org ([127.0.0.1]) by localhost (beryllium.ruby-lang.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14476-01 for ; Fri, 16 Dec 2005 02:43:59 +0900 (JST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.207]) by beryllium.ruby-lang.org (Postfix) with ESMTP id 0A51333DD9 for ; Fri, 16 Dec 2005 02:43:58 +0900 (JST) Received: by wproxy.gmail.com with SMTP id i31so422813wra for ; Thu, 15 Dec 2005 09:43:53 -0800 (PST) Received: by 10.54.127.3 with SMTP id z3mr2579336wrc; Thu, 15 Dec 2005 09:43:52 -0800 (PST) Received: by 10.54.114.18 with HTTP; Thu, 15 Dec 2005 09:43:50 -0800 (PST) Delivered-To: ruby-talk@ruby-lang.org Date: Fri, 16 Dec 2005 02:44:00 +0900 Posted: Thu, 15 Dec 2005 12:43:50 -0500 From: Mark Ericson Reply-To: ruby-talk@ruby-lang.org Subject: Re: Easy Duck-Typing To: ruby-talk@ruby-lang.org (ruby-talk ML) Message-Id: <237f7cfb0512150943k348fc2eak7abda881556bd57c@mail.gmail.com> In-Reply-To: References: <43a1914f$0$144$edfadb0f@dread11.news.tele.dk> X-ML-Name: ruby-talk X-Mail-Count: 79 X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-talk-ctl@ruby-lang.org; help= X-Original-To: ruby-talk@ruby-lang.org DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AQj2d7z+tI+zAkPRawhBeuc89AI7uMABbCqgb4Pq/FN3XzWq1JcGgt3/7ygIdWtEmt8HA9LUHQuBCkPePYKZsvW55hGACiz+z0344hd/5t4o1taolxS7w4o5Na/4qD+8Xp/Cl8kjQNJtYNi827JnVvC79UV1Rlteg58IUQ34RtQ= Content-Disposition: inline X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ruby-lang.org X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on beryllium.ruby-lang.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=7.0 tests=AWL,BAYES_00,BLARS00, BLARS_SPAM00,CONTENT_TYPE_PRESENT,MIMEQENC,QENCPTR2,RCVDFRMLOCALIP, RCVD_BY_IP,RCVD_IN_BLARS,RCVD_IN_BLARS_HOOPS,RCVD_IN_BLARS_SPAM autolearn=ham version=3.0.3 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Precedence: bulk Lines: 11 List-Id: ruby-talk.ruby-lang.org List-Software: fml [fml 4.0.3 release (20011202/4.0.3)] List-Post: List-Owner: List-Help: List-Unsubscribe: X-Virus-Scanned: by AMaViS snapshot-20020531 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by blade.nagaokaut.ac.jp id jBFHiUZk029990 > The thrust of duck typing, as I > understand it, is that you just ask an object to do something -- > without regard to its class, and quite likely without doing a > respond_to? call first. I've pondered if duck typing is about an object being able to respond to a specific method or if it is about a set of methods. I also wonder if a mechanism like Objective-C's 'protocol' would be useful in Ruby. - Mark