Skip to content

Commit 1ab8c76

Browse files
committed
update url and remove functions that are in stdlib
1 parent 37e6c67 commit 1ab8c76

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

editor/app.scm

+1-35
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,12 @@
1717
(print x)
1818
x)
1919

20-
(define-macro (define-global first . rest)
21-
"(define-global var value)
22-
(define-global (name . args) body)
23-
24-
Macro that define functions or variables in global context, so they can be used
25-
inside let and get let variables in closure, Useful for universal macros."
26-
(if (pair? first)
27-
(let ((name (car first)))
28-
`(lips.env.set ,(symbol->string name) (lambda ,(cdr first) ,@rest)))
29-
`(lips.env.set ,(symbol->string first) ,(car rest))))
30-
31-
(define-macro (globalize expr . rest)
32-
"(globalize expr)
33-
34-
Macro will get the value of the expression and add each method as function to global
35-
scope."
36-
(let ((obj (eval expr (current-environment)))
37-
(make-name (if (pair? rest)
38-
(let ((pre (symbol->string (car rest))))
39-
(lambda (name) (string->symbol (concat pre name))))
40-
string->symbol)))
41-
`(begin
42-
,@(filter pair?
43-
(map (lambda (key)
44-
(if (function? (. obj key))
45-
(let* ((fname (gensym))
46-
(args (gensym)))
47-
`(define-global (,(make-name key) . ,args)
48-
(apply (. ,expr ,key) ,args)))))
49-
(array->list (--> Object (keys obj))))))))
50-
51-
5220
;; setup isomorphic-git and global fs methods as functions
5321
(define fs (let* ((fs (new LightningFS "fs"))
5422
(pfs fs.promises))
5523
(git.plugins.set "fs" fs)
5624
pfs))
5725

58-
59-
6026
(define (new-repo dir)
6127
"Prepare new git repo with base app"
6228
(let ((dir (if (null? (match #/^\// dir)) (concat "/" dir) dir)))
@@ -86,7 +52,7 @@
8652
(console.log msg))))
8753
(console.log (concat "Registration succeeded. Scope is " req.scope)))
8854
(catch (e)
89-
(console.log (concat "Registration failed " e)))))
55+
(console.log (concat "Registration failed " (repr e))))))
9056

9157
(define refresh-editors (debounce (lambda ()
9258
(for-each (lambda (editor)

editor/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<![endif]-->
1111
<script src="bundle-b.js"></script>
1212
<script src="bundle-a.js"></script>
13-
<script src="../../repo/dist/lips.js"></script>
13+
<script src="https://cdn.jsdelivr.net/gh/jcubic/lips@devel/dist/lips.min.js"></script>
1414
<script src="https://cdn.jsdelivr.net/gh/jcubic/lips@devel/lib/js/terminal.js"></script>
1515
<script src="https://cdn.jsdelivr.net/gh/jcubic/lips@devel/lib/js/prism.js"></script>
1616
<link rel="stylesheet" href="style.css"/>

0 commit comments

Comments
 (0)