From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 573C3BDCB for ; Thu, 8 Sep 2005 22:04:45 +0200 (CEST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.190]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j88K4ish004913 for ; Thu, 8 Sep 2005 22:04:45 +0200 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1EDSdX-00045Y-00; Thu, 08 Sep 2005 22:04:43 +0200 Received: from [84.58.134.13] (helo=gate.lan.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1EDSdW-0005J2-00; Thu, 08 Sep 2005 22:04:42 +0200 Received: from flakew.lan.gerd-stolpmann.de (flakew.lan.gerd-stolpmann.de [192.168.0.32]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id 60AEAC0C3; Thu, 8 Sep 2005 22:04:42 +0200 (CEST) Subject: Re: [Caml-list] Trouble Defining an Object From: Gerd Stolpmann To: Paul Snively Cc: caml-list@yquem.inria.fr In-Reply-To: <70DC8B53-7958-4CC6-A979-2CDFE4E03386@mac.com> References: <70DC8B53-7958-4CC6-A979-2CDFE4E03386@mac.com> Content-Type: text/plain Date: Thu, 08 Sep 2005 22:04:40 +0200 Message-Id: <1126209882.12036.155.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:a6865a839c0178d9aa0ce41878507ea2 X-Miltered: at concorde with ID 4320995C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 gerd:01 stolpmann:01 foo:01 expr:01 expr:01 foo:01 gerd:01 donnerstag:01 hash:01 ocamlsdl:01 findlib:01 ocamlsdl:01 toplevel:01 usr:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 That's a purely syntactic issue. Instead of class foo = expr1; expr2; object ... end use: class foo = let () = expr1 in let () = expr2 in object ... end Only "let var = expr in expr" may be used between "class" and "object". Gerd Am Donnerstag, den 08.09.2005, 11:12 -0700 schrieb Paul Snively: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Folks, > > I'm trying to define a class that, given a string containing bytes > from, e.g. an MP3, Ogg Vorbis, etc. music, contains that music. > Later, of course, I'll make the class actually do something with the > data, but for right now I can't even get the code to compile. I'm > using the current ocamlsdl and findlib. Here's a copy of my session > in the ocamlsdl toplevel: > - ----------------------------snip snip---------------------------- > Objective Caml version 3.08.4 > > # #require "sdl.sdlmixer";; > /usr/local/lib/ocaml/site-lib/sdl: added to search path > /usr/local/lib/ocaml/site-lib/sdl/sdlmixer.cma: loaded > # open Sdlmixer;; > # open Filename;; > # class foo init_song = > let name, chan = open_temp_file ~mode:[Open_binary] "foo" "bar" in > output_string chan init_song; > close_out chan; > let the_song = load_music name in > object > val mutable song = the_song > end;; > Characters 123-124: > output_string chan init_song; > ^ > Syntax error > - ----------------------------snip snip---------------------------- > > I'm at a loss to understand where the error lies. Any advice would be > greatly appreciated. > > Many thanks and best regards, > Paul > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (Darwin) > > iEYEARECAAYFAkMgfwcACgkQO3fYpochAqKSnQCgtaAHbn6WNPyBf5dymt+E2l8n > IzEAoIzGA4Xb5igB719KOf/msuEBG/wD > =HlQ/ > -----END PGP SIGNATURE----- > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Telefon: 06151/153855 Telefax: 06151/997714 ------------------------------------------------------------