Re: More static type fun.

From: Marcin 'Qrczak' Kowalczyk (qrczak_at_knm.org.pl)
Date: 10/29/03


Date: Wed, 29 Oct 2003 08:39:24 +0100

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.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


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.
    ... Kowalczyk wrote: ... > The call is written in the caller. ... > 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 ...
    (comp.lang.lisp)