From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7C440BB83 for ; Wed, 13 Sep 2006 20:58:38 +0200 (CEST) Received: from ms-smtp-04.ohiordc.rr.com (ms-smtp-04.ohiordc.rr.com [65.24.5.138]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k8DIwb8o017547 for ; Wed, 13 Sep 2006 20:58:38 +0200 Received: from [192.168.1.121] (cpe-71-74-145-210.neo.res.rr.com [71.74.145.210]) by ms-smtp-04.ohiordc.rr.com (8.13.6/8.13.6) with ESMTP id k8DIwVhu025722 for ; Wed, 13 Sep 2006 14:58:31 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v752.2) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: caml-list@yquem.inria.fr From: Jeremy Cowgar Subject: Passing class type as parameter? Date: Wed, 13 Sep 2006 14:58:24 -0400 X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Miltered: at concorde with ID 450854DD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; model:01 model:01 syntax:01 finder:98 finder:98 inherit:01 parameter:02 let:03 let:03 passing:04 passing:04 problem:05 generic:08 object:09 object:09 Can I do something like: class base_model = object(self) method from_array ary = ... end ;; class user = object(self) inherit base_model ... end ;; let finder sql class_type = query_database sql ; let res = new class_type in res#from_array res ;; let users = finder "SELECT * FROM users" user in xxx yyy ;; Ok. That is not working code, prob has syntax errors as well, but you get my idea. The problem I am having is passing the class to the generic finder method. Thanks, Jeremy