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).
This commit is contained in:
Eli Barzilay 2010-09-17 21:31:52 -04:00
parent 53adab8271
commit 126c7d1a0d
3 changed files with 101 additions and 106 deletions

View File

@ -20,7 +20,7 @@
@(apply parlist @strong{PLT Publications} @(apply parlist @strong{PLT Publications}
(cons techreports (cons techreports
(for*/list ([place (in-list all-places)] (for*/list ([place (in-list all-places)]
[pubs (in-value (place-pubs-url place))] [pubs (in-value (place-pubs place))]
#:when pubs) #:when pubs)
@a[href: pubs]{@(place-name place)}))) @a[href: pubs]{@(place-name place)})))
@parlist[@strong{Graduate Study} @parlist[@strong{Graduate Study}
@ -40,17 +40,12 @@
string<?) string<?)
" / ")) " / "))
@(define responsible-people @(define responsible-people
(let ([people
(for/list ([p (in-list all-places)])
(define edu (place-edu p))
(ormap (lambda (p)
(and (equal? edu (person-responsible-for p)) p))
all-people))])
(add-between (add-between
(for/list ([person (sort people string<? #:key person-name)]) (for/list ([person (sort (map (compose car place-people) all-places)
string<? #:key person-name)])
@a[href: (person-url person)]{ @a[href: (person-url person)]{
@(regexp-replace #rx" .*$" (person-name person) "")}) @(regexp-replace #rx" .*$" (person-name person) "")})
", "))) ", "))
@h1{Graduate Study with PLT} @h1{Graduate Study with PLT}
@p{An open letter to graduate applicants:} @p{An open letter to graduate applicants:}
@div[style: (box-style 3 "#ddd")]{ @div[style: (box-style 3 "#ddd")]{

View File

@ -1,93 +1,97 @@
#lang at-exp s-exp "shared.rkt" #lang at-exp s-exp "shared.rkt"
(define -all-people- ; "First Last" bib-name|#f responsible-for|#f url (define (make-all place person)
'(["Shriram Krishnamurthi" #f "brown" ;; The first person in a place is the one responsible for it
"http://www.cs.brown.edu/~sk/"] (list
["Jay McCarthy" #f "byu" (place ; -------------------------------------------------------------------
"http://faculty.cs.byu.edu/~jay/"] 'neu "Northeastern University"
["John Clements" #f "calpoly" #:location "Boston, MA"
"http://users.csc.calpoly.edu/~clements/"] #:url "http://www.ccs.neu.edu/scheme/"
["Matthias Felleisen" #f "neu" #:pubs "http://www.ccs.neu.edu/scheme/pubs/"
"http://www.ccs.neu.edu/home/matthias/"] (person 'matthias "Matthias Felleisen"
["Robby Findler" "Robert Bruce Findler" "northwestern" #:url "http://www.ccs.neu.edu/home/matthias/")
"http://www.eecs.northwestern.edu/~robby/"] (person 'eli "Eli Barzilay"
["Matthew Flatt" #f "utah" #:url "http://barzilay.org/"))
"http://www.cs.utah.edu/~mflatt/"] (place ; -------------------------------------------------------------------
["Kathi Fisler" #f "wpi" 'utah "University of Utah"
"http://web.cs.wpi.edu/~kfisler/"])) #:location "Salt Lake City, UT"
#:url "http://www.cs.utah.edu/plt/"
#:pubs "http://www.cs.utah.edu/plt/publications/"
(person 'mflatt "Matthew Flatt"
#:url "http://www.cs.utah.edu/~mflatt/"))
(place ; -------------------------------------------------------------------
'nwu "Northwestern University"
#:location "Evanston, IL"
#:url "http://plt.eecs.northwestern.edu/"
#:pubs "http://www.eecs.northwestern.edu/~robby/pubs/"
(person 'robby "Robby Findler"
#:bibname "Robert Bruce Findler"
#:url "http://www.eecs.northwestern.edu/~robby/"))
(place ; -------------------------------------------------------------------
'brown "Brown University"
#:location "Providence, RI"
#:url "http://www.cs.brown.edu/research/plt/"
#:pubs "http://www.cs.brown.edu/~sk/Publications/Papers/"
(person 'shriram "Shriram Krishnamurthi"
#:url "http://www.cs.brown.edu/~sk/"))
(place ; -------------------------------------------------------------------
'byu "Brigham Young University"
#:location "Provo, UT"
#:url "http://faculty.cs.byu.edu/~jay/"
(person 'jay "Jay McCarthy"
#:url "http://faculty.cs.byu.edu/~jay/"))
(place ; -------------------------------------------------------------------
'calpoly "California Polytechnic State University"
#:location "San Luis Obispo, CA"
#:url "http://users.csc.calpoly.edu/~clements/"
(person 'clements "John Clements"
#:url "http://users.csc.calpoly.edu/~clements/"))
(place ; -------------------------------------------------------------------
'wpi "Worcester Polytechnic Institute"
#:location "Worcester, MA"
#:url "http://web.cs.wpi.edu/~kfisler/"
(person 'kathi "Kathi Fisler"
#:url "http://web.cs.wpi.edu/~kfisler/"))))
(define -all-places- ; "Name" "Location, ST" url pubs-url|# ;; ----------------------------------------------------------------------------
'(["Brown University" "Providence, RI"
"http://www.cs.brown.edu/research/plt/"
"http://www.cs.brown.edu/~sk/Publications/Papers/"]
["Brigham Young University" "Provo, UT"
"http://faculty.cs.byu.edu/~jay/"
#f]
["California Polytechnic State University" "San Luis Obispo, CA"
"http://users.csc.calpoly.edu/~clements/"
#f]
["Northeastern University" "Boston, MA"
"http://www.ccs.neu.edu/scheme/"
"http://www.ccs.neu.edu/scheme/pubs/"]
["Northwestern University" "Evanston, IL"
"http://plt.eecs.northwestern.edu/"
"http://www.eecs.northwestern.edu/~robby/pubs/"]
["University of Utah" "Salt Lake City, UT"
"http://www.cs.utah.edu/plt/"
"http://www.cs.utah.edu/plt/publications/"]
["Worcester Polytechnic Institute" "Worcester, MA"
"http://web.cs.wpi.edu/~kfisler/"
#f]))
(require racket/list racket/string) (struct person (nick name url bibname place) #:prefab)
(struct place (nick name location url pubs people) #:prefab)
(provide (struct-out person) (struct-out place)) (provide (struct-out place) all-places find-place
(struct person (name bib-name responsible-for url edu search-string)) (struct-out person) all-people find-person)
(struct place (name location url pubs-url edu search-string))
;; list of all people and places, and functions to search them with some (require racket/list)
;; (unique) word
(provide all-people all-places find-person find-place) (define-values (all-places find-place all-people find-person)
(define-values (all-people all-places find-person find-place)
(let () (let ()
(define (make maker url-pos args-list) (define places0
(for/list ([args (in-list args-list)]) (make-all
(let ([url (list-ref args url-pos)] ;; make a place
[search (string-downcase (string-join (filter values args) (lambda (nick name #:location loc #:url url #:pubs [pubs #f] . people)
"; "))] (place nick name loc url pubs people))
[rx #rx"^http://[^/]*[.]([^.]+)[.]edu/"]) ;; make a person
(apply maker `(,@args (lambda (nick name #:url url #:bibname [bibname name])
,(cadr (or (regexp-match rx url) (person nick name url bibname (make-placeholder #f)))))
(error 'person/place (for* ([place (in-list places0)]
"no X.edu found in ~a" url))) [person (in-list (place-people place))])
,search))))) (placeholder-set! (person-place person) place))
(define people (make person 3 -all-people-)) (define places (make-reader-graph places0))
(define places (make place 2 -all-places-)) (define people (append-map place-people places))
(unless (equal? places (remove-duplicates places #:key place-edu)) (when (ormap (lambda (p) (null? (place-people p))) places)
(error 'places "found multiple places with the same X.edu url")) (error 'places "all places should have people in them"))
(unless (equal? (sort (map place-edu places) string<?) (define (make-finder what xs get-nick)
(sort (map person-responsible-for people) string<?)) (define t (make-hasheq))
(error 'places/people "no direct mapping between `edu' of places and ~a" (for ([x (in-list xs)])
"responsible-for of people")) (hash-update! t (get-nick x)
(define (finder name all get-search-string) (lambda (old)
(let ([t (make-hasheq)]) (if old (error what "got duplicate nicks") x))
(lambda (x) #f))
(let ([x (if (string? x) (string->symbol x) x)]) (lambda (nick)
(hash-ref! (or (hash-ref t nick #f)
t x (error what "nick not found: ~s" nick))))
(lambda () (values places (make-finder 'places places place-nick)
(let* ([rx (regexp-quote (string-downcase (symbol->string x)))] people (make-finder 'people people person-nick))))
[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))))
(provide people) (provide people)
(define people (define people

View File

@ -1,7 +1,7 @@
#lang at-exp s-exp "shared.rkt" #lang at-exp s-exp "shared.rkt"
(require "bib.rkt" (prefix-in - version/utils) racket/list (require "bib.rkt" (prefix-in - version/utils) racket/list
"../download/data.rkt") "people.rkt" "../download/data.rkt")
(provide techreports) (provide techreports)
(define techreports (define techreports
@ -20,25 +20,20 @@
(define authors (define authors
'([plt "PLT"] '([plt "PLT"]
[mflatt "Matthew Flatt"]
[robby "Robert Bruce Findler"]
[ff mflatt robby] [ff mflatt robby]
[fplt mflatt plt] [fplt mflatt plt]
[rplt robby plt] [rplt robby plt]
[ffplt ff plt] [ffplt ff plt]
[ffc ff clements] [ffc ff clements]
[fb mflatt eli] [fb mflatt eli]
[eli "Eli Barzilay"]
[clements "John Clements"]
[dorai "Dorai Sitaram"] [dorai "Dorai Sitaram"]
[wright "Andrew K. Wright"] [wright "Andrew K. Wright"]
[flanagan "Cormac Flanagan"] [flanagan "Cormac Flanagan"]
[web burns gregp jaym] [web burns gregp jay]
[burns "Mike Burns"] [burns "Mike Burns"]
[jaym "Jay McCarthy"]
[gregp "Greg Pettyjohn"] [gregp "Greg Pettyjohn"]
[dyoo "Danny Yoo"] [dyoo "Danny Yoo"]
[ym dyoo jaym] [ym dyoo jay]
[kathyg "Kathryn E. Gray"] [kathyg "Kathryn E. Gray"]
[jacobm "Jacob Matthews"] [jacobm "Jacob Matthews"]
[sowens "Scott Owens"] [sowens "Scott Owens"]
@ -107,7 +102,7 @@
(redex "4.1...!" robby "Redex: Debugging Operational Semantics") (redex "4.1...!" robby "Redex: Debugging Operational Semantics")
(scribble "*...!" fb "Scribble: PLT Documentation Tool") (scribble "*...!" fb "Scribble: PLT Documentation Tool")
(slideshow "*...!" ff "Slideshow: PLT Figure and Presentation Tools") (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") (tools "*...!" robby "Plugins: Extending DrScheme")
(gui "*...!" ffc "GUI: PLT Graphics Toolkit") (gui "*...!" ffc "GUI: PLT Graphics Toolkit")
(framework "*...!" ff "Framework: PLT GUI Application Framework") (framework "*...!" ff "Framework: PLT GUI Application Framework")
@ -175,7 +170,7 @@
(drracket "!..." rplt "DrRacket: Programming Environment") (drracket "!..." rplt "DrRacket: Programming Environment")
(scribble "!..." fb "Scribble: Racket Documentation Tool") (scribble "!..." fb "Scribble: Racket Documentation Tool")
(slideshow "!..." ff "Slideshow: Racket Figure and Presentation Tools") (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") (foreign "!..." eli "FFI: Racket Foreign Interface")
(inside "!..." mflatt "Inside: Racket C API") (inside "!..." mflatt "Inside: Racket C API")
@ -258,7 +253,8 @@
t)) t))
(define (author->string author) (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) (if (string? r)
r r
(let ([r (apply string-append (let ([r (apply string-append