From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA10602; Thu, 27 May 2004 23:11:45 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA10588 for ; Thu, 27 May 2004 23:11:44 +0200 (MET DST) Received: from mailout03.sul.t-online.com (mailout03.sul.t-online.com [194.25.134.81]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i4RLBhEV023613 for ; Thu, 27 May 2004 23:11:44 +0200 Received: from fwd07.aul.t-online.de by mailout03.sul.t-online.com with smtp id 1BTSAB-00040e-02; Thu, 27 May 2004 23:11:43 +0200 Received: from t-online.de (SrAFHvZVreb5rrWvd588wF4X-xbtoHqLp9Ydmnm2oBwvKJOJfSq9k-@[217.95.165.153]) by fwd07.sul.t-online.com with esmtp id 1BTSA3-0F2SqO0; Thu, 27 May 2004 23:11:35 +0200 Message-ID: <40B65986.2030603@t-online.de> Date: Thu, 27 May 2004 23:11:34 +0200 From: szegedy@t-online.de (Christian Szegedy) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20040214 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list Subject: Re: [Caml-list] Looking for collaborators on a hobby project Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Seen: false X-ID: SrAFHvZVreb5rrWvd588wF4X-xbtoHqLp9Ydmnm2oBwvKJOJfSq9k- X-Miltered: at nez-perce with ID 40B6598F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 vyper:01 vyper:01 failwith:01 val:01 val:01 ocaml:01 ocaml:01 mutable:01 mutable:01 penalty:02 match:02 transform:02 ruby:02 typing:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dear Skaller! Is the Vyper project public? I could not find any version of Vyper on the net. :( You have written, that the analyis of the type information turned out be difficult. I can believe this. :) However, this is something already solved. In fact, this is solved in Ocaml! So, I would not have to solve it directly. Now, my idea is the following: Suppose, we have the following Ruby class: class A def f(x,y) x.g(y,@a) end def h(x) f(@b,v) end end Then the interpreter would simply transform it to the following OCaml class: type 'a myref = Nil | Obj of 'a let use x = match x with | Obj x -> x | Nil -> failwith "Dereferencing nil" class ['f_x,'f_y,'h_x,'a,'b] a = object(self) val mutable a:('a myref) = Nil val mutable b:('b myref) = Nil method f ( x : 'f_x) (y : 'f_y) = (use x)#g y a method h ( v : 'f_x) = self#f b v end After that, OCaml would take care of all the typing stuff... Of course using the myref class comes with a performance penalty also. This can be eliminated if one does not allow nil at all: that is all instance variables must have valid default value. I think, this is a good idea anyway... ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners