From 126c7d1a0d36dba9d73649b5f9306b5201a2ed82 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Fri, 17 Sep 2010 21:31:52 -0400 Subject: [PATCH] Change the people/places structs and way they are made. It's also possible to use this as a central place to hold the list of plt people for other purposes, works for the bib authors now (requires making an organized list of the people). --- collects/meta/web/www/learning.rkt | 19 ++- collects/meta/web/www/people.rkt | 170 +++++++++++++------------- collects/meta/web/www/techreports.rkt | 18 ++- 3 files changed, 101 insertions(+), 106 deletions(-) diff --git a/collects/meta/web/www/learning.rkt b/collects/meta/web/www/learning.rkt index deb3f7e290..cc4cb0cae0 100644 --- a/collects/meta/web/www/learning.rkt +++ b/collects/meta/web/www/learning.rkt @@ -20,7 +20,7 @@ @(apply parlist @strong{PLT Publications} (cons techreports (for*/list ([place (in-list all-places)] - [pubs (in-value (place-pubs-url place))] + [pubs (in-value (place-pubs place))] #:when pubs) @a[href: pubs]{@(place-name place)}))) @parlist[@strong{Graduate Study} @@ -40,17 +40,12 @@ stringsymbol x) x)]) - (hash-ref! - t x - (lambda () - (let* ([rx (regexp-quote (string-downcase (symbol->string x)))] - [rx (pregexp (string-append "\\b" rx "\\b"))]) - (let loop ([found #f] [l all]) - (cond - [(null? l) (or found (error name "couldn't find: ~.a" x))] - [(not (regexp-match? rx (get-search-string (car l)))) - (loop found (cdr l))] - [found (error name "ambiguous search: ~.a" x)] - [else (loop (car l) (cdr l))]))))))))) - (values people places - (finder 'find-person people person-search-string) - (finder 'find-place places place-search-string)))) + (define places0 + (make-all + ;; make a place + (lambda (nick name #:location loc #:url url #:pubs [pubs #f] . people) + (place nick name loc url pubs people)) + ;; make a person + (lambda (nick name #:url url #:bibname [bibname name]) + (person nick name url bibname (make-placeholder #f))))) + (for* ([place (in-list places0)] + [person (in-list (place-people place))]) + (placeholder-set! (person-place person) place)) + (define places (make-reader-graph places0)) + (define people (append-map place-people places)) + (when (ormap (lambda (p) (null? (place-people p))) places) + (error 'places "all places should have people in them")) + (define (make-finder what xs get-nick) + (define t (make-hasheq)) + (for ([x (in-list xs)]) + (hash-update! t (get-nick x) + (lambda (old) + (if old (error what "got duplicate nicks") x)) + #f)) + (lambda (nick) + (or (hash-ref t nick #f) + (error what "nick not found: ~s" nick)))) + (values places (make-finder 'places places place-nick) + people (make-finder 'people people person-nick)))) (provide people) (define people diff --git a/collects/meta/web/www/techreports.rkt b/collects/meta/web/www/techreports.rkt index ddecff4f53..6957aca046 100644 --- a/collects/meta/web/www/techreports.rkt +++ b/collects/meta/web/www/techreports.rkt @@ -1,7 +1,7 @@ #lang at-exp s-exp "shared.rkt" (require "bib.rkt" (prefix-in - version/utils) racket/list - "../download/data.rkt") + "people.rkt" "../download/data.rkt") (provide techreports) (define techreports @@ -20,25 +20,20 @@ (define authors '([plt "PLT"] - [mflatt "Matthew Flatt"] - [robby "Robert Bruce Findler"] [ff mflatt robby] [fplt mflatt plt] [rplt robby plt] [ffplt ff plt] [ffc ff clements] [fb mflatt eli] - [eli "Eli Barzilay"] - [clements "John Clements"] [dorai "Dorai Sitaram"] [wright "Andrew K. Wright"] [flanagan "Cormac Flanagan"] - [web burns gregp jaym] + [web burns gregp jay] [burns "Mike Burns"] - [jaym "Jay McCarthy"] [gregp "Greg Pettyjohn"] [dyoo "Danny Yoo"] - [ym dyoo jaym] + [ym dyoo jay] [kathyg "Kathryn E. Gray"] [jacobm "Jacob Matthews"] [sowens "Scott Owens"] @@ -107,7 +102,7 @@ (redex "4.1...!" robby "Redex: Debugging Operational Semantics") (scribble "*...!" fb "Scribble: PLT Documentation Tool") (slideshow "*...!" ff "Slideshow: PLT Figure and Presentation Tools") - (web-server "*...!" jaym "Web Server: PLT HTTP Server") + (web-server "*...!" jay "Web Server: PLT HTTP Server") (tools "*...!" robby "Plugins: Extending DrScheme") (gui "*...!" ffc "GUI: PLT Graphics Toolkit") (framework "*...!" ff "Framework: PLT GUI Application Framework") @@ -175,7 +170,7 @@ (drracket "!..." rplt "DrRacket: Programming Environment") (scribble "!..." fb "Scribble: Racket Documentation Tool") (slideshow "!..." ff "Slideshow: Racket Figure and Presentation Tools") - (web-server "!..." jaym "Web Server: Racket HTTP Server") + (web-server "!..." jay "Web Server: Racket HTTP Server") (foreign "!..." eli "FFI: Racket Foreign Interface") (inside "!..." mflatt "Inside: Racket C API") @@ -258,7 +253,8 @@ t)) (define (author->string author) - (let ([r (hash-ref authors* author)]) + (let ([r (hash-ref authors* author + (lambda () (person-bibname (find-person author))))]) (if (string? r) r (let ([r (apply string-append