www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

not-implemented-yet.scrbl (2635B)


      1 #lang scribble/manual
      2 @require[racket/require
      3          "utils.rkt"
      4          @for-label[phc-toolkit/not-implemented-yet]]
      5 @title{not-implemented-yet}
      6 @author{@author+email["Suzanne Soy" "racket@suzanne.soy"]}
      7 @defmodule[phc-toolkit/not-implemented-yet
      8            #:use-sources
      9            [(submod (lib "phc-toolkit/not-implemented-yet.rkt") typed)]]
     10 
     11 @defform[(? type expr ...)]{
     12  Can be used as a placeholder for an expression returning @racket[type]. This
     13  form throws an error at run-time, but will allow the program to typecheck so
     14  that the developer can focus on other parts without a myriad of type errors,
     15  and can come back to implement the @racket[?] placeholders later.
     16 
     17  The @racket[expr ...] expressions are included within a @racket[lambda]
     18  function, after the @racket[(error "Not implemented yet")], so Typed/Racket's
     19  dead code detection will ignore most type errors within those expressions.
     20  This makes @racket[?] useful as a joker to temporarily ignore type errors
     21  within the expressions, while annotating them with the type they should
     22  normally have once they are fixed.}
     23 
     24 @defform[(?* expr ...)]{
     25 
     26  Can be used as a placeholder for an expression returning @racket[Nothing].
     27  This form throws an error at run-time, but will allow the program to typecheck
     28  so that the developer can focus on other parts without a myriad of type
     29  errors, and can come back to implement the expressions marked with @racket[?*]
     30  later.
     31  
     32  The @racket[expr ...] expressions are included within a @racket[lambda]
     33  function, after the @racket[(error "Not implemented yet")], so Typed/Racket's
     34  dead code detection will ignore most type errors within those expressions.
     35  This makes @racket[?*] useful as a joker to temporarily ignore type errors
     36  within the expressions. @racket[?*] is also useful as a joker to allow the
     37  whole @racket[(?* expr ...)] expression to be used as an argument to nearly
     38  any function, as it has the type @racket[Nothing], i.e. "bottom", which is a
     39  subtype of (nearly) all other types (no value has the type @racket[Nothing],
     40  i.e. it is the return type of functions which never return, which is the case
     41  here, since @racket[?*] always throws an error at run-time.
     42 
     43  Caveat: the @racket[Nothing] type can propagate (when Typed/Racket encounters
     44  a function called with @racket[Nothing] as the type of one of its arguments,
     45  it may mark the return value of that function as @racket[Nothing] too, since
     46  the call may never happen). This means that other parts of the code may be
     47  considered dead code, and type errors in these other parts may be ignored.}
     48 
     49 @include-section{not-implemented-yet-untyped.scrbl}