@@ -85,7 +85,7 @@ define taglib playground ()
85
85
output("%s" ,
86
86
get-attribute(page-context(), $main-code-attr)
87
87
| get-query-value($main-code-attr)
88
- | find-example-code($hello-world ));
88
+ | find-example-code($default-example ));
89
89
end ;
90
90
tag library-code (page :: <playground-page>) ()
91
91
begin
@@ -95,9 +95,10 @@ define taglib playground ()
95
95
tag examples-menu (page :: <playground-page>) ()
96
96
for (v in $examples)
97
97
let name = v[0 ];
98
- output("<option value=\" %s\" >%s</option>\n " , name, name);
98
+ output("<option value=\" %s\" %s>%s</option>\n " ,
99
+ name, (name = $default-example & "selected" ) | "" , name);
99
100
end ;
100
- tag example (page :: <playground-page>) (name :: <string> = $hello-world )
101
+ tag example (page :: <playground-page>) (name :: <string> = $default-example )
101
102
output(find-example-code(name) | "example not found" );
102
103
end ;
103
104
@@ -119,7 +120,7 @@ define method respond-to-post (resource :: <build-and-run>, #key) => ()
119
120
else
120
121
result[$compiler-output-attr] := "Please enter some code." ;
121
122
end ;
122
- encode -json(current-response(), result );
123
+ print -json(result, current-response());
123
124
end method ;
124
125
125
126
define function generate-project-name () => (project-name :: <string> )
@@ -253,7 +254,7 @@ define module %s
253
254
use print;
254
255
use pprint;
255
256
use streams;
256
- // from libraries with only one exported module
257
+ // from libraries with one module, named the same as the library.
257
258
use hash-algorithms;
258
259
use logging;
259
260
use regular-expressions;
0 commit comments