Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
(define-module ralph/repl/browser-evaluator
import: (ralph/repl/evaluator)
export: (<browser-evaluator>))
(define-class <browser-evaluator> (<evaluator>))
(define-method evaluate ((evaluator <browser-evaluator>) code)
(%eval code))
(define-method send-data ((evaluator <browser-evaluator>) data)
(. (get evaluator "connection")
(send data)))
(define-method prepare-evaluator ((evaluator <browser-evaluator>)))
(define-method inject-commands! ((evaluator <browser-evaluator>))
(%set (%native "$changeModule")
(curry change-module evaluator))
(%eval "$moduleRoot['%in-module'] = $changeModule"))
(define-method connect-to-interactor ((evaluator <browser-evaluator>) url)
(bind ((connection (%native-call "new WebSocket" url)))
(set! (get evaluator "connection")
connection)
(set! (get connection "onmessage")
(method (message)
(handle-message evaluator (get message "data"))))))