Loading ...
Sorry, an error occurred while loading the content.

11160Re: "ocaml_beginners"::[] Re: Module parameterization by ints

Expand Messages
  • Ashish Agarwal
    Jul 1, 2009
    • 0 Attachment
      > Then you can apply the previous answers
      If Squeue.create returns a queue bounded to a specific size, wouldn't that
      be a non-functorized solution? Then, you no longer need the solutions
      previously mentioned.


      On Wed, Jul 1, 2009 at 4:47 AM, Vincent Aravantinos <
      vincent.aravantinos@...> wrote:

      >
      >
      > --- In ocaml_beginners@yahoogroups.com <ocaml_beginners%40yahoogroups.com>,
      > Phil Tomson <rubyfan@...> wrote:
      > > Following up on this question: I need to do something very similar to
      > > the original poster's question but the answer given isn't quite clear
      > > to me.
      > >
      > > I would like to create a FIFO that is limited to N slots. I'd like to
      > > create a FIFO module that can be parameterized by an integer (N) so
      > > that I can create a FIFO of a specific size. How would I go about
      > > doing this?
      >
      > Good starting points:
      > - if you accept an imperative FIFO : module Queue of the standard library
      > - if you want a functional FIFO : module Fqueue of Jane Street's Core
      > library (http://ocaml.janestreet.com/?q=node/13, also available with Godi)
      > - finally module Squeue of Jane Street's Core library seems to do kinda
      > what you want
      >
      > This last module's signature contains the following:
      >
      > (** [create maxsize] returns a synchronized queue bounded to have no more
      > than
      > [maxsize] elements. *)
      > val create : int -> 'a t
      >
      > Then you can apply the previous answers (but maybe it is this last point
      > which is the problem ?).
      >
      > Cheers
      >
      >
      >


      [Non-text portions of this message have been removed]
    • Show all 8 messages in this topic