FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pixie/pixie/repl.pxi at add-sorting · pixie-lang/pixie · GitHub
pixie-lang
/
pixie
Public
Notifications
You must be signed in to change notification settings
Fork
127
Star
2.4k
Code
Issues
46
Pull requests
9
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
pixie
/
pixie
/
repl.pxi
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (27 loc) · 1018 Bytes
Breadcrumbs
pixie
/
pixie
/
repl.pxi
Copy path
File metadata and controls
30 lines (27 loc) · 1018 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(ns pixie.repl
(:require [pixie.stacklets :
as
st]
[pixie.io :
as
io]
[pixie.ffi
-
infer :
as
f]))
(f
/
with
-
config {:library
"
edit
"
:includes [
"
editline/readline.h
"
]}
(f
/
defcfn readline))
(defn repl []
(let [rdr (reader
-
fn (fn []
(let [prompt (
if
(
=
0
pixie.stdlib
/*
reading
-
form
*
)
(
str
(name pixie.stdlib
/*
ns
*
)
"
=>
"
)
"
"
)
line (st
/
apply
-
blocking readline prompt)]
(
if
line
(
str
line
"
\n
"
)
"
"
))))]
(loop []
(
try
(let [form (read rdr false)]
(
if
(
or
(
=
form eof) (
=
form :exit))
(exit
0
)
(let [x (
eval
form)]
(pixie.stdlib
/-
push
-
history x)
(prn x))))
(catch ex
(pixie.stdlib
/-
set
-*
e ex)
(println
"
ERROR:
\n
"
ex)))
(recur))))
Back
|
FazBrowse Home
|
New Git URL