Used ~a instead of string-append, to concatenate long lines.
This commit is contained in:
parent
770e75834f
commit
b3c746276a
|
@ -295,7 +295,7 @@ The code above needs some identifiers derived from @tc[mapping] names:
|
|||
|
||||
@subsection{Making with-promises nodes}
|
||||
|
||||
We derive the @tc[with-promises] type from each @emph{ideal} node type, using
|
||||
We derive the @tc[with-promises] type from each @emph{ideal} node type using
|
||||
the @tc[tmpl-replace-in-type] template metafunction from the rewrite-type
|
||||
library. We replace all occurrences of a @tc[node] name with a @tc[Promise] for
|
||||
that node's @tc[with-promises] type.
|
||||
|
@ -311,6 +311,24 @@ that node's @tc[with-promises] type.
|
|||
(define-temp-ids "~a/make-with-promises" (node ...))
|
||||
(define-temp-ids "~a/with-promises-type" (node ...))]
|
||||
|
||||
@subsection{Making incomplete nodes}
|
||||
|
||||
We derive the @tc[incomplete] type from each @emph{ideal} node type using
|
||||
the @tc[tmpl-replace-in-type] template metafunction from the rewrite-type
|
||||
library. We replace all occurrences of a @tc[node] name with a union of the
|
||||
node's @tc[incomplete] type, and all compatible @tc[placeholder] types.
|
||||
|
||||
@; TODO: use a type-expander here, instead of a template metafunction.
|
||||
|
||||
@CHUNK[<define-with-promises>
|
||||
(define-type node/incomplete-type
|
||||
(tmpl-replace-in-type (List 'node field-type ...)
|
||||
([node (U node/incomplete-type
|
||||
mapping/placeholder-type ...)] ...)))]
|
||||
|
||||
@chunk[<define-ids>
|
||||
(define-temp-ids "~a/make-with-promises" (node ...))
|
||||
(define-temp-ids "~a/with-promises-type" (node ...))]
|
||||
|
||||
@subsection{Processing the placeholders}
|
||||
|
||||
|
|
|
@ -201,9 +201,9 @@ as values.
|
|||
(list (set-add past-queue element)
|
||||
(combine-results element result result-acc)
|
||||
#;(if (hash-has-key? result-hash element)
|
||||
(error (string-append
|
||||
"Duplicate key in fold-queue-sets."
|
||||
"Are you using mutable elements?"))
|
||||
(error (~a "Duplicate key " element
|
||||
" in fold-queue-sets."
|
||||
"Are you using mutable elements?"))
|
||||
(hash-set result-hash element result))
|
||||
new-acc))))]
|
||||
|
||||
|
@ -372,7 +372,8 @@ was a tag requested.
|
|||
racket/syntax
|
||||
"../lib/low-untyped.rkt")
|
||||
"../lib/low.rkt"
|
||||
racket/set)
|
||||
racket/set
|
||||
racket/format)
|
||||
|
||||
(provide fold-queue
|
||||
map-queue
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#lang debug scribble/lp2
|
||||
@(require "../lib/doc.rkt")
|
||||
@doc-lib-setup
|
||||
@(require racket/format)
|
||||
|
||||
@title[#:style manual-doc-style]{Rewriting data structures and their types}
|
||||
|
||||
|
@ -246,8 +247,8 @@ Handling freer forms of unions causes some problems:
|
|||
|
||||
These issues and possible solutions are addressed in more
|
||||
detail in the
|
||||
@hyperlink[(string-append "https://phc.fogbugz.com/f/cases/54/"
|
||||
"Rethink-how-to-do-the-multi-step-types-more-inside")]
|
||||
@hyperlink[(~a "https://phc.fogbugz.com/f/cases/54/"
|
||||
"Rethink-how-to-do-the-multi-step-types-more-inside")]
|
||||
{FogBugz case 54}.
|
||||
|
||||
@section[#:tag "sec:fold"]{Folding over an instance}
|
||||
|
|
|
@ -39,10 +39,9 @@ contain the expander procedure, or directly an expander procedure.
|
|||
[else
|
||||
(raise-argument-error
|
||||
'prop:type-expander-guard
|
||||
(string-append
|
||||
"an exact non-negative integer designating a field index "
|
||||
"within the structure that should contain a procedure of "
|
||||
"arity 1, or a procedure of arity 1.")
|
||||
(~a "an exact non-negative integer designating a field index "
|
||||
"within the structure that should contain a procedure of "
|
||||
"arity 1, or a procedure of arity 1.")
|
||||
val)]))]
|
||||
|
||||
If the value is a field index, it should be within bounds. The
|
||||
|
@ -832,9 +831,10 @@ in @tc[racket], not @tc[typed/racket]).
|
|||
|
||||
@chunk[<module-expander>
|
||||
(module expander racket
|
||||
(require racket)
|
||||
(require syntax/parse)
|
||||
(require syntax/stx)
|
||||
(require racket
|
||||
syntax/parse
|
||||
syntax/stx
|
||||
racket/format)
|
||||
|
||||
(require (for-template typed/racket))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user