1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > SCM-Slang - Scheme Implementation</ title >
7+ < style >
8+ body {
9+ font-family : Arial, sans-serif;
10+ max-width : 800px ;
11+ margin : 0 auto;
12+ padding : 20px ;
13+ line-height : 1.6 ;
14+ }
15+ .hero {
16+ background : # f4f4f4 ;
17+ padding : 20px ;
18+ border-radius : 8px ;
19+ margin-bottom : 30px ;
20+ }
21+ .link-box {
22+ background : # e8f4fd ;
23+ border : 1px solid # 0066cc ;
24+ border-radius : 4px ;
25+ padding : 15px ;
26+ margin : 20px 0 ;
27+ }
28+ .link-box code {
29+ background : # fff ;
30+ padding : 2px 6px ;
31+ border-radius : 3px ;
32+ font-family : 'Courier New' , monospace;
33+ word-break : break-all;
34+ }
35+ .instructions {
36+ background : # f9f9f9 ;
37+ border-left : 4px solid # 0066cc ;
38+ padding : 15px ;
39+ margin : 20px 0 ;
40+ }
41+ </ style >
42+ </ head >
43+ < body >
44+ < div class ="hero ">
45+ < h1 > 🚀 SCM-Slang</ h1 >
46+ < p > Scheme-based implementations of Source, written in TypeScript</ p >
47+ </ div >
48+
49+ < h2 > 📦 GitHub Pages Distribution</ h2 >
50+ < p > This repository provides a built version of the SCM-Slang library for use with Source Academy.</ p >
51+
52+ < div class ="link-box ">
53+ < h3 > 🔗 Library URL for Source Academy</ h3 >
54+ < p > Use this URL in Source Academy's feature flag:</ p >
55+ < code id ="library-url "> https://source-academy.github.io/scm-slang/index.js</ code >
56+ < button onclick ="copyToClipboard() " style ="margin-left: 10px; padding: 5px 10px; background: #0066cc; color: white; border: none; border-radius: 3px; cursor: pointer; "> Copy</ button >
57+ </ div >
58+
59+ < div class ="instructions ">
60+ < h3 > 📝 How to use in Source Academy</ h3 >
61+ < ol >
62+ < li > Go to Source Academy settings</ li >
63+ < li > Navigate to the feature flags section</ li >
64+ < li > Find the external library configuration</ li >
65+ < li > Paste the URL above as the library source</ li >
66+ < li > Enable the Scheme language feature</ li >
67+ </ ol >
68+ </ div >
69+
70+ < h2 > 🧪 Available Exports</ h2 >
71+ < ul >
72+ < li > < strong > parseSchemeSimple</ strong > - Simple Scheme parser</ li >
73+ < li > < strong > evaluate</ strong > - Scheme evaluator using CSE machine</ li >
74+ < li > < strong > createProgramEnvironment</ strong > - Create Scheme environment</ li >
75+ < li > < strong > SchemeEvaluator</ strong > - Conductor-compatible evaluator</ li >
76+ < li > < strong > BasicEvaluator</ strong > - Basic evaluator implementation</ li >
77+ < li > < strong > SchemeComplexNumber</ strong > - Complex number support</ li >
78+ </ ul >
79+
80+ < h2 > 🔍 Testing the Library</ h2 >
81+ < p > You can test if the library loads correctly by opening the browser console and running:</ p >
82+ < pre style ="background: #f4f4f4; padding: 10px; border-radius: 4px; overflow-x: auto; "> < code > // Load the library
83+ const script = document.createElement('script');
84+ script.src = 'https://source-academy.github.io/scm-slang/index.js';
85+ document.head.appendChild(script);
86+
87+ // After loading, you can test:
88+ // parseSchemeSimple('(+ 1 2)');
89+ // evaluate('(+ 1 2)', ...);
90+ </ code > </ pre >
91+
92+ < script >
93+ function copyToClipboard ( ) {
94+ const url = document . getElementById ( 'library-url' ) . textContent ;
95+ navigator . clipboard . writeText ( url ) . then ( ( ) => {
96+ alert ( 'URL copied to clipboard!' ) ;
97+ } ) . catch ( err => {
98+ console . error ( 'Failed to copy: ' , err ) ;
99+ } ) ;
100+ }
101+ </ script >
102+ </ body >
103+ </ html >
0 commit comments