Create data/ collection.
- Initially populated with queues, skip-lists, and interval-maps from unstable/ - Tests in tests/data, docs in data/scribblings
This commit is contained in:
parent
46b2a2113a
commit
0635fc6d75
3
collects/data/info.rkt
Normal file
3
collects/data/info.rkt
Normal file
|
@ -0,0 +1,3 @@
|
|||
#lang setup/infotab
|
||||
(define scribblings
|
||||
'(("scribblings/data.scrbl" (multi-page) (experimental))))
|
|
@ -3,7 +3,7 @@
|
|||
(require racket/contract
|
||||
racket/promise
|
||||
racket/dict
|
||||
unstable/skip-list)
|
||||
data/skip-list)
|
||||
|
||||
;; NOTE-1
|
||||
;; I need to be able to split intervals. So I can either have
|
21
collects/data/scribblings/data.scrbl
Normal file
21
collects/data/scribblings/data.scrbl
Normal file
|
@ -0,0 +1,21 @@
|
|||
#lang scribble/doc
|
||||
@(require scribble/base
|
||||
scribble/manual
|
||||
(for-syntax racket/base racket/path)
|
||||
(for-label scribble/base))
|
||||
|
||||
@title[#:tag "data"]{Data Structures}
|
||||
|
||||
@defmodule[data]
|
||||
|
||||
This manual documents data structure libraries available in the
|
||||
@racketmodname[data] collection.
|
||||
|
||||
@local-table-of-contents[#:style 'immediate-only]
|
||||
|
||||
@;{--------}
|
||||
|
||||
@include-section["queue.scrbl"]
|
||||
@include-section["skip-list.scrbl"]
|
||||
@include-section["interval-map.scrbl"]
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
#lang scribble/manual
|
||||
@(require scribble/eval
|
||||
"utils.rkt"
|
||||
(for-label unstable/interval-map
|
||||
(for-label data/interval-map
|
||||
racket/contract
|
||||
racket/dict
|
||||
racket/base))
|
||||
|
@ -9,18 +8,18 @@
|
|||
@title[#:tag "interval-map"]{Interval Maps}
|
||||
|
||||
@(define the-eval (make-base-eval))
|
||||
@(the-eval '(require unstable/interval-map))
|
||||
@(the-eval '(require data/interval-map))
|
||||
@(the-eval '(require racket/dict))
|
||||
|
||||
@defmodule[unstable/interval-map]
|
||||
@defmodule[data/interval-map]
|
||||
|
||||
@unstable[@author+email["Ryan Culpepper" "ryanc@racket-lang.org"]]
|
||||
@author[@author+email["Ryan Culpepper" "ryanc@racket-lang.org"]]
|
||||
|
||||
An interval-map is a mutable dictionary-like data structure where
|
||||
mappings are added by @emph{half-open} intervals and queried by
|
||||
discrete points. Interval-maps can be used with any total
|
||||
order. Internally, an interval-map uses a skip-list
|
||||
(@racketmodname[unstable/skip-list]) of intervals for efficient query
|
||||
(@racketmodname[data/skip-list]) of intervals for efficient query
|
||||
and update.
|
||||
|
||||
Interval-maps implement the dictionary (@racketmodname[racket/dict])
|
|
@ -1,12 +1,12 @@
|
|||
#lang scribble/manual
|
||||
@(require scribble/eval "utils.rkt" (for-label racket unstable/queue))
|
||||
@(define qeval (eval/require 'unstable/queue))
|
||||
@(require scribble/eval "utils.rkt" (for-label racket data/queue))
|
||||
@(define qeval (eval/require 'data/queue))
|
||||
|
||||
@title{Imperative Queues}
|
||||
|
||||
@defmodule[unstable/queue]
|
||||
@defmodule[data/queue]
|
||||
|
||||
@unstable[@author+email["Carl Eastlund" "cce@racket-lang.org"]]
|
||||
@author[@author+email["Carl Eastlund" "cce@racket-lang.org"]]
|
||||
|
||||
This module provides a simple mutable queue representation,
|
||||
first-in/first-out only. Operations on queues mutate it in a
|
|
@ -1,7 +1,6 @@
|
|||
#lang scribble/manual
|
||||
@(require scribble/eval
|
||||
"utils.rkt"
|
||||
(for-label unstable/skip-list
|
||||
(for-label data/skip-list
|
||||
racket/contract
|
||||
racket/dict
|
||||
racket/base))
|
||||
|
@ -9,12 +8,12 @@
|
|||
@title[#:tag "skip-list"]{Skip Lists}
|
||||
|
||||
@(define the-eval (make-base-eval))
|
||||
@(the-eval '(require unstable/skip-list))
|
||||
@(the-eval '(require data/skip-list))
|
||||
@(the-eval '(require racket/dict))
|
||||
|
||||
@defmodule[unstable/skip-list]
|
||||
@defmodule[data/skip-list]
|
||||
|
||||
@unstable[@author+email["Ryan Culpepper" "ryanc@racket-lang.org"]]
|
||||
@author[@author+email["Ryan Culpepper" "ryanc@racket-lang.org"]]
|
||||
|
||||
Skip lists are a simple, efficient data structure for mutable
|
||||
dictionaries with totally ordered keys. They were described in the
|
9
collects/data/scribblings/utils.rkt
Normal file
9
collects/data/scribblings/utils.rkt
Normal file
|
@ -0,0 +1,9 @@
|
|||
#lang at-exp racket/base
|
||||
(require scribble/base scribble/manual scribble/core scribble/eval)
|
||||
(provide eval/require)
|
||||
|
||||
(define (eval/require . paths)
|
||||
(let* ([e (make-base-eval)])
|
||||
(for ([path (in-list paths)])
|
||||
(e `(require ,path)))
|
||||
e))
|
|
@ -4,7 +4,7 @@
|
|||
racket/gui
|
||||
drracket/arrow
|
||||
framework/framework
|
||||
unstable/interval-map
|
||||
data/interval-map
|
||||
unstable/gui/notify
|
||||
"interfaces.rkt")
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#lang racket/base
|
||||
|
||||
(require rackunit rackunit/text-ui unstable/queue "helpers.rkt")
|
||||
(require rackunit rackunit/text-ui data/queue)
|
||||
|
||||
(run-tests
|
||||
(test-suite "queue.ss"
|
|
@ -86,7 +86,6 @@ Keep documentation and tests up to date.
|
|||
@include-section["planet.scrbl"]
|
||||
@include-section["port.scrbl"]
|
||||
@include-section["pretty.scrbl"]
|
||||
@include-section["queue.scrbl"]
|
||||
@include-section["regexp.scrbl"]
|
||||
@include-section["require.scrbl"]
|
||||
@include-section["sandbox.scrbl"]
|
||||
|
@ -108,8 +107,6 @@ Keep documentation and tests up to date.
|
|||
@include-section["sequence.scrbl"]
|
||||
@include-section["hash.scrbl"]
|
||||
@include-section["match.scrbl"]
|
||||
@include-section["skip-list.scrbl"]
|
||||
@include-section["interval-map.scrbl"]
|
||||
@include-section["generics.scrbl"]
|
||||
@include-section["markparam.scrbl"]
|
||||
@include-section["debug.scrbl"]
|
||||
|
|
Loading…
Reference in New Issue
Block a user