Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Do it [SchemeBBS]

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.

Name: Anonymous 2015-05-26 19:21

#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))))

Name: Anonymous 2015-05-26 19:29

>>27
get fixed
(define (get id)
(car
(memf (lambda (post) (= id (cdr (assoc 'id post))))
post-list)))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List