On Wed, 18 Feb 2009, Mark J. Reed wrote:

On Wed, Feb 18, 2009 at 6:36 AM, Richard Hainsworth
<rich...@rusrating.ru> wrote:
What needs to be abstracted so that a perl6 program can know that a
Writeable may not be able to accept data (eg., because the file system is
full)?

I don't understand the question.  To be a Writable, an object must
have a mechanism for accepting data.  That mechanism may fail for any
of a large number of reasons (out of space, no permission, etc...),
but that's orthogonal to the fact that it's a Writable.  A Readable is
not the same thing as "a Writable you can't actually write to right
now".

I've added an isWriteable to the IO::Writeable filehandle, which should hopefully cover what Richard is after.

Side question: are HTTP URI's Writable?  If so, I imagine that
translates into a PUT.  Is there any benefit in abstracting out the
functionality of POST in a way that maps to other resource types?

Hmm. Interesting question. My reason for getting into S16 in the first place was that I was interested in implementing some protocols. The generic mechanisms that I think would be generally useful for protocols are:
-       A grammar language, for the grammar of the protocol
-       An event loop (see Perl 5 module "POE")
-       A finite state machine (see POE again)

What I've been wondering about is how a grammar of the protocol would interact with something that generates the protocol. I see the HTTP POST command as an instance of the more general "Command with data"-type setup, such as also occurs with SMTP's "data" command, although I think the two are slightly different.

Anyway, I see the S16 method called "prompt" to be a step in the right direction, although it doesn't seem to be attached to an appropriate class/role yet, and also probably couldn't deal with the HTTP POST command.

These are just some random thoughts that occurred to me; maybe they'll spark something in someone's mind.

        :)


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayl...@wayland.id.au    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----

Reply via email to