Name: Anonymous 2015-05-25 10:11
Can we fucking wake up here sheeple? We need a SchemeBBS. We need to restore all of prog.db in it. This regex crap the admin does is no good right now for the job.
#lang racket
(define (go)
'yep-it-works)
(define (error e)
e) ;; for now
(define (version)
1)
(define post-count 0)
(define (index)
post-count)
(define post-list null)
(define (get id)
(memf (lambda (post) (assoc post 'id))
post-list))
; ((id . <int>)
; (date . <date>)
; (reply . <int or #f>)
; (post . <string>))
;; make-post creates the server post from the client post
(define (make-post post)
(list
(cons 'id (index))
(cons 'date (current-seconds))
;; no (reply . <int>) yet
(assoc 'post post)))
;; post takes the server post and simply appends it to post-list
;; also incrementing post-count
(define (post alist)
(begin
(set! post-list
(cons (make-post alist)
post-list))
(set! post-count (+ 1 post-count))))