caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Trouble Defining an Object
Date: Thu, 8 Sep 2005 21:52:36 +0100	[thread overview]
Message-ID: <200509082152.37921.jon@ffconsultancy.com> (raw)
In-Reply-To: <70DC8B53-7958-4CC6-A979-2CDFE4E03386@mac.com>

On Thursday 08 September 2005 19:12, Paul Snively wrote:
> # #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;;

Perhaps you want:

class foo init_song =
  let name, chan = open_temp_file ~mode:[Open_binary] "foo" "bar" in
  let () =
    output_string chan init_song;
    close_out chan in
  let the_song = load_music name in
object
  val mutable song = the_song
end;;

or even:

let foo init_song =
  let chan = open_out "foo" in
  let () =
    output_string chan init_song;
    close_out chan in
  let the_song = load_music name in
object
  val mutable song = the_song
end;;

But I'm not sure...

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


      parent reply	other threads:[~2005-09-08 20:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-08 18:12 Paul Snively
2005-09-08 20:04 ` [Caml-list] " Gerd Stolpmann
2005-09-08 20:52 ` Jon Harrop [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200509082152.37921.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).