Re: More static type fun.

From: Erann Gat (gat_at_jpl.nasa.gov)
Date: 10/29/03


Date: Wed, 29 Oct 2003 10:49:45 -0800

In article <pan.2003.10.29.07.39.23.886122@knm.org.pl>, Marcin 'Qrczak'
Kowalczyk <qrczak@knm.org.pl> wrote:

> On Tue, 28 Oct 2003 19:29:03 -0800, Erann Gat wrote:
>
> > 1. The objective is to be able to write the actual call in the caller
> > code, otherwise there's no point. One might as well write "error"
> > directly. Writing "stub" buys you nothing.
>
> The call is written in the caller. Stub replaces the body of the
> definition of the function which doesn't exist, not its call. The function
> can even be given the correct type before it's implemented.
>
> > 2. Having all the unimplemented calls go to the same function wouldn't
> > type-check.
>
> It would. There was an error in the previous post though.
>
> stub :: a -- Means: any type (not only functions, you can stub any object)
> stub = error "Not implemented yet"
>
> In ML you can stub only functions this way, but all functions using one stub.

My ignorance is showing here -- I presume then that ML and Haskell have
the semantics that all functions take only one argument, and that calling
a function with more than one argument passes a tuple, is that right?

In that case, yes, a single stub would work. That diminishes the
magnitude of my objection from being a major problem to a minor
annoyance. But we should probably put this branch of the discussion on
hold until I have a chance to go learn ML and/or Haskell so that I
actually know what I'm talking about. Which one should I start with (or
is there something else I should look at first)?

E.



Relevant Pages

  • Re: Single threaded class for COM interop
    ... the 3 methods you list are for ensuring the caller ... > called in the apartment threaded model. ... > each method in the business layer. ... This 'stub' will declare a new ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: More static type fun.
    ... Marcin 'Qrczak' Kowalczyk writes: ... > In ML you can stub only functions this way, but all functions using one stub. ... Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp ...
    (comp.lang.lisp)
  • Re: More static type fun.
    ... The call is written in the caller. ... Stub replaces the body of the ... can even be given the correct type before it's implemented. ... > type-check. ...
    (comp.lang.lisp)