caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Michael Wohlwend <micha-1@fantasymail.de>
To: caml-list@yquem.inria.fr, james woodyatt <jhw@wetware.com>
Subject: Re: [Caml-list] state pattern...
Date: Mon, 27 Jun 2005 00:45:05 +0200	[thread overview]
Message-ID: <200506270045.05724.micha-1@fantasymail.de> (raw)
In-Reply-To: <3fce1487ee8fd9f28edbe70276980346@wetware.com>

On Monday 27 June 2005 00:13, james woodyatt wrote:
> I tend to work in the functional style first, then transfer what I've
> done into imperative style if there is a performance gain to be had by
> it.  Here's what I would do to make something like what you want:

really very helpful, your code snippet.

>
> You get into a problem pretty quickly if the state class needs to be
> aware of the full type of the context in order to compute the next
> state.  What that really means is that the context *is* the state, and
> you need to rethink how the pattern is supposed to be applied to your
> design.

that's why in my code the function which does the work of the state and sets 
the new one gets the context as a parameter, but I didn't get this right.
I know that the pattern has it's limitations...

thanks
 Michael


  reply	other threads:[~2005-06-26 22:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-26 19:57 Michael Wohlwend
2005-06-26 22:13 ` [Caml-list] " james woodyatt
2005-06-26 22:45   ` Michael Wohlwend [this message]
2005-06-27 23:23   ` Michael Wohlwend
2005-06-28  0:54     ` Jacques Garrigue
2005-06-28 12:24       ` Michael Wohlwend
2005-06-28 13:20         ` Jacques Garrigue

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=200506270045.05724.micha-1@fantasymail.de \
    --to=micha-1@fantasymail.de \
    --cc=caml-list@yquem.inria.fr \
    --cc=jhw@wetware.com \
    /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).