Skip to content

Commit

Permalink
add another example for syntax extensions with browserFS
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 18, 2024
1 parent bf8f9cb commit 09b94b4
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions examples/syntax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<meta name="Description" content=""/>
<link rel="shortcut icon" href=""/>
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--
<link href="css/style.css" rel="stylesheet"/>
-->
<style>

</style>
<script src="https://cdn.jsdelivr.net/npm/browserfs@1.x.x/dist/browserfs.min.js"></script>
<script src="./dist/lips.js"></script>
<script type="text/x-scheme" bootstrap="./dist/std.min.scm">
(let ((fname "data.scm"))
(if (not (file-exists? fname))
(call-with-output-file fname
(lambda (port)
(write '(+ 1 2 3 4) port))))

(call-with-input-file "data.scm"
(lambda (port)
(print (read port)))))

(set-special! "#:" 'frob lips.specials.LITERAL)

(define (frob filename)
(call-with-input-file filename
(lambda (port)
(read port))))

(print '(define x #:"data.scm"))

</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>

</body>
</html>

0 comments on commit 09b94b4

Please sign in to comment.