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.
,______ ___ ___ ____.,
/* ' ' ' \_
| \
- ~ ~lmbd
| \
- |
/ \
- ________________________ \
. _ _/ \_ \ __.,._
. \.., / \,. *__/ \
'* / *
/ | /
\_ ,._.#####.__. .___#####._,. /- -.-
*,==| <._# )> vvvv <. # )> |==#" \
/ | | | | \ *
^_ | .,-* / \ | / /
/_ /\__________/ \_________/ - |
/ (__ __ ) | / \__,
| ** \ / " /.
" / \ \_- / /
\ / / v |
- | /
\ ,-''"''--"''"'-.. / \
\ \.,.-,.,.--,.../ |
\_ |
\_ _____ /.
.-/ <>>>____,.,..,____/ ___ / \
,./ \ .
,.*/ \ |\
* * \ /\
,.___/ | \ / |
\
| -- G. J. Sussman
It would also get rid us of the "whom are you quoting" dude.Kill yourself.
#### SchemeBBS: protocol version 1
## Introduction: The SchemeBBS server works as a regular TCP server. It is communicated to and responds with s-expressions.
## Errors
If a query fails the server well return (error <e>) where the form e contains some information about the problem.
## Posts: Posts are assoc lists of the following form:
((id . <int>)
(date . <date>)
(reply . <int or #f>)
(post . <string>))
all these fields must be present except reply, which is optional.
clients should ignore extra unknown fields.
## Commands:
(version) ;=> 1
(get <int>) ;=> returns the post of that id or (error "No such post") if there is no post of that id.
(post <assoc-list>) ;=> the assoc list should be a post without the date, if a client sends date it will be ignored. The server should return the post id on success.
(posts> <int>) ;=> return a list of all posts whose id is larger in ascending order of post id.
#lang racket
(require racket/tcp)
(let-values (((in out) (tcp-connect "localhost" 7777)))
(let loop ()
(let ((command (read)))
(displayln command out)
(flush-output out)
(let ((form (read in)))
(displayln form)
(loop)))))
#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))))
the easiest way to do this is to write a fastcgi wrapper around some embeddable scheme you're complicating things, just use SIG alert and fork to timeout and limit resources
It would also get rid us of the "whom are you quoting" dudeThere's a better solution: you could stop being an meme-spewing imageboarder. Hard to believe there was another solution, I know.
> (display '(ayy "goo tee"))
(ayy goo tee)
> (print '(ayy "goo tee"))
'(ayy "goo tee")
> (write '(ayy "goo tee"))
(ayy "goo tee")