Welcome to the CHICKEN Scheme pasting service

Potential bug in "format" pasted by zilti 3 days ago

(define content "{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"hello\", \"params\": {\"name\": \"World!\"}}")

(display (format "client.scm: sent \"Content-Length: ~a\r\n\r\n~a\""
                 (+ 4 (string-length content)) content))

;; Results in:
;; client.scm: sent "Content-Length: 80
;;

(display (format "client.scm: sent \"Content-Length: ~a\r\n\r\n~a\"\n"
                 (+ 4 (string-length content)) content))

;; Results in:
;; client.scm: sent "Content-Length: 80
;; 
;; {"jsonrpc": "2.0", "id": 1, "method": "hello", "params": {"name": "World!"}}"

Also borked added by sjamaan 3 days ago

(define (write-content content)
  ((##sys#slot (##sys#slot out 2) 3) out (format "Content-Length: ~a\r\n\r\n~a"
                                 (+ 4 (string-length content))
                                 content))
  (flush-output-port out))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the result of `(let ((spammers 'dumb)) spammers)'?
Visually impaired? Let me spell it for you (wav file) download WAV