[Gd-chatter] r11720 - in trunk/libraries: network/koala/sources/dylan-basics network/koala/sources/examples/code-browser network/koala/sources/examples/koala-basics network/koala/sources/examples/web-objects network/koala/sources/koala network/koala/sources/xml-rpc-common network/wiki network/xml-rpc-client network/xmpp/xmpp-test uri
cgay at gwydiondylan.org
cgay at gwydiondylan.org
Sat Mar 1 12:18:40 CET 2008
Author: cgay
Date: Sat Mar 1 12:18:37 2008
New Revision: 11720
Modified:
trunk/libraries/network/koala/sources/dylan-basics/dylan-basics.dylan
trunk/libraries/network/koala/sources/dylan-basics/library.dylan
trunk/libraries/network/koala/sources/examples/code-browser/class.dylan
trunk/libraries/network/koala/sources/examples/code-browser/generic-function.dylan
trunk/libraries/network/koala/sources/examples/code-browser/library-objects.dylan
trunk/libraries/network/koala/sources/examples/code-browser/library.dylan
trunk/libraries/network/koala/sources/examples/code-browser/main.dylan
trunk/libraries/network/koala/sources/examples/code-browser/module-variable.dylan
trunk/libraries/network/koala/sources/examples/code-browser/module.dylan
trunk/libraries/network/koala/sources/examples/code-browser/search.dylan
trunk/libraries/network/koala/sources/examples/koala-basics/library.dylan
trunk/libraries/network/koala/sources/examples/web-objects/library.dylan
trunk/libraries/network/koala/sources/koala/responders.dylan
trunk/libraries/network/koala/sources/koala/server.dylan
trunk/libraries/network/koala/sources/xml-rpc-common/library.dylan
trunk/libraries/network/wiki/library.dylan
trunk/libraries/network/xml-rpc-client/library.dylan
trunk/libraries/network/xmpp/xmpp-test/xmpp-test-exports.dylan
trunk/libraries/uri/uri.dylan
Log:
job: koala
* Fixed code-browser
* Some split-related fixes, mostly removing "exclude: { split }"
and changing remove-empty-items: to remove-if-empty:.
Modified: trunk/libraries/network/koala/sources/dylan-basics/dylan-basics.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/dylan-basics/dylan-basics.dylan (original)
+++ trunk/libraries/network/koala/sources/dylan-basics/dylan-basics.dylan Sat Mar 1 12:18:37 2008
@@ -223,11 +223,6 @@
-define inline-only function whitespace?
- (ch :: <character>) => (white? :: <boolean>)
- member?(ch, #[' ', '\t', '\n'])
-end;
-
// ----------------------------------------------------------------------
// For removing certain keyword/value pairs from argument lists before
// passing them along with apply or next-method.
Modified: trunk/libraries/network/koala/sources/dylan-basics/library.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/dylan-basics/library.dylan (original)
+++ trunk/libraries/network/koala/sources/dylan-basics/library.dylan Sat Mar 1 12:18:37 2008
@@ -10,7 +10,7 @@
define module dylan-basics
use dylan;
- use common-extensions, exclude: { split };
+ use common-extensions;
use streams, import: { write, with-output-to-string };
export
Modified: trunk/libraries/network/koala/sources/examples/code-browser/class.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/code-browser/class.dylan (original)
+++ trunk/libraries/network/koala/sources/examples/code-browser/class.dylan Sat Mar 1 12:18:37 2008
@@ -3,14 +3,19 @@
Author: Andreas Bogk, Bastian Mueller, Hannes Mehnert
define body tag slots in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
- do-all-slots(method(x) dynamic-bind(*environment-object* = x) do-body() end end, *project*, *environment-object*);
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
+ do-all-slots(method(x)
+ dynamic-bind(*environment-object* = x)
+ do-body()
+ end
+ end,
+ *project*, *environment-object*);
end;
define body tag direct-superclasses in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
for (superclass in class-direct-superclasses(*project*, *environment-object*))
dynamic-bind(*environment-object* = superclass)
do-body()
@@ -19,8 +24,8 @@
end;
define body tag direct-subclasses in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
for (subclass in class-direct-subclasses(*project*, *environment-object*))
dynamic-bind(*environment-object* = subclass)
do-body()
@@ -29,16 +34,14 @@
end;
define tag slot-name in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- format(output-stream(response), "%s",
- html-name(slot-getter(*project*, *environment-object*)));
+ (page :: <code-browser-page>)
+ ()
+ output("%s", html-name(slot-getter(*project*, *environment-object*)));
end;
define tag slot-type in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- format(output-stream(response), "%s",
- html-name(slot-type(*project*, *environment-object*)));
+ (page :: <code-browser-page>)
+ ()
+ output("%s", html-name(slot-type(*project*, *environment-object*)));
end;
Modified: trunk/libraries/network/koala/sources/examples/code-browser/generic-function.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/code-browser/generic-function.dylan (original)
+++ trunk/libraries/network/koala/sources/examples/code-browser/generic-function.dylan Sat Mar 1 12:18:37 2008
@@ -3,80 +3,67 @@
Author: Andreas Bogk, Bastian Mueller, Hannes Mehnert
define body tag generic-function-parameters in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag function-parameters in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag parameter-name in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag parameter-type in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag rest in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag keyword-parameters in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag parameter-keyword in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag parameter-default-value in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag all-keys in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag next-method in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag values in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag rest-value in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
define body tag print-method-signature in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
-
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
end;
Modified: trunk/libraries/network/koala/sources/examples/code-browser/library-objects.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/code-browser/library-objects.dylan (original)
+++ trunk/libraries/network/koala/sources/examples/code-browser/library-objects.dylan Sat Mar 1 12:18:37 2008
@@ -3,8 +3,8 @@
Author: Andreas Bogk, Bastian Mueller, Hannes Mehnert
define body tag modules in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
do-library-modules(method(x)
dynamic-bind(*environment-object* = x)
do-body()
@@ -13,8 +13,8 @@
end;
define body tag defined-modules in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
do-library-modules(method(x)
dynamic-bind(*environment-object* = x)
do-body()
@@ -23,8 +23,8 @@
end;
define body tag used-libraries in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
do-used-definitions(method(x)
dynamic-bind(*environment-object* = x)
do-body()
Modified: trunk/libraries/network/koala/sources/examples/code-browser/library.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/code-browser/library.dylan (original)
+++ trunk/libraries/network/koala/sources/examples/code-browser/library.dylan Sat Mar 1 12:18:37 2008
@@ -41,8 +41,8 @@
use format-out;
use streams;
use file-system;
- use dsp, exclude: { split };
- use regular-expressions, import: { regex-replace };
+ use dsp;
+ use regular-expressions;
use source-records;
use source-records-implementation;
use environment-protocols,
Modified: trunk/libraries/network/koala/sources/examples/code-browser/main.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/code-browser/main.dylan (original)
+++ trunk/libraries/network/koala/sources/examples/code-browser/main.dylan Sat Mar 1 12:18:37 2008
@@ -14,9 +14,10 @@
end;
define generic environment-object-page (obj :: <environment-object>) => (res :: <code-browser-page>);
-define directory responder symbol-responder ("/symbol")
- (request, response)
- let suffix = split(request.request-url-tail, '/');
+
+define function symbol-responder (#key match :: <regex-match>)
+ let tail = match-group(match, 0);
+ let suffix = split(tail, '/');
//format-out("hit /: %= %d\n", suffix, suffix.size);
if (suffix.size > 0)
let library-name = suffix[0];
@@ -33,29 +34,38 @@
if (suffix.size = 3)
let symbol-name = suffix[2];
let symbol
- = find-environment-object(project, symbol-name, library: library, module: module);
+ = find-environment-object(project, symbol-name,
+ library: library,
+ module: module);
dynamic-bind(*environment-object* = symbol)
- process-template(environment-object-page(*environment-object*), request, response);
+ process-template(environment-object-page(*environment-object*));
end;
else
dynamic-bind(*environment-object* = module)
- process-template(environment-object-page(*environment-object*), request, response);
+ process-template(environment-object-page(*environment-object*));
end;
end;
else
dynamic-bind(*environment-object* = library)
- process-template(environment-object-page(*environment-object*), request, response);
+ process-template(environment-object-page(*environment-object*));
end;
end;
end;
end;
end;
+define url-map
+ url "/symbol"
+ action GET ("^.*$") => symbol-responder;
+end;
+
-define page raw-source-page (<code-browser-page>)
- (source: "raw-source.dsp")
+define class <raw-source-page> (<code-browser-page>)
end;
+define variable *raw-source-page*
+ = make(<raw-source-page>, source: "code-browser/raw-source.dsp");
+
define method environment-object-page (object :: <environment-object>)
=> (res :: <code-browser-page>)
*raw-source-page*;
@@ -67,9 +77,11 @@
pages:
{ } => { }
{ ?page:name, ... }
- => { define page ?page ## "-page" (<code-browser-page>)
- (source: ?"page" ## ".dsp")
+ => { define class "<" ## ?page ## "-page>" (<code-browser-page>)
end;
+ define variable "*" ## ?page ## "-page*"
+ = make("<" ## ?page ## "-page>",
+ source: "code-browser/" ## ?"page" ## ".dsp");
define method environment-object-page
(object :: "<" ## ?page ## "-object>") => (res :: "<" ## ?page ## "-page>")
"*" ## ?page ## "-page*";
@@ -84,30 +96,35 @@
end;
define tag source in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- format(output-stream(response), "%s",
- markup-dylan-source(environment-object-source(*project*, *environment-object*)));
+ (page :: <code-browser-page>)
+ ()
+ output("%s",
+ markup-dylan-source(environment-object-source(*project*,
+ *environment-object*)));
end;
define tag project-name in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- write(output-stream(response), *project*.project-name);
+ (page :: <code-browser-page>)
+ ()
+ output(*project*.project-name);
end;
define function markup-dylan-source(source :: <string>)
=> (processed-source :: <string>);
- regexp-replace(regexp-replace(regexp-replace(source, "&", "&"), "<", "<"), ">", ">");
+ regex-replace(">",
+ regex-replace("<",
+ regex-replace("&", source, "&"),
+ "<"),
+ ">");
end function markup-dylan-source;
//XXX: refactor this into the specific tags - each tag which may be a reference
// knows for itself best where to link!
define tag canonical-link in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- format(output-stream(response), "%s", do-canonical-link(*environment-object*));
+ (page :: <code-browser-page>)
+ ()
+ output("%s", do-canonical-link(*environment-object*));
end;
define method do-canonical-link (symbol)
let name-object = environment-object-home-name(*project*, symbol);
@@ -157,13 +174,13 @@
end;
define tag display-name in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- format(response.output-stream, "%s", html-name(*environment-object*));
+ (page :: <code-browser-page>)
+ ()
+ output("%s", html-name(*environment-object*));
end;
define body tag used-definitions in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
for (used-definition in source-form-used-definitions(*project*, *environment-object*))
dynamic-bind (*environment-object* = used-definition)
do-body()
@@ -174,92 +191,91 @@
//These tags are not used currently!
define tag project-sources in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
+ (page :: <code-browser-page>)
+ ()
dynamic-bind(*check-source-record-date?* = #f)
- format(response.output-stream, "<pre>\n");
+ output("<pre>\n");
for(source in *project*.project-sources)
block()
- format(response.output-stream,
- "<h3>%s</h3> module <strong>%s</strong>\n",
+ output("<h3>%s</h3> module <strong>%s</strong>\n",
source-record-location(source),
source-record-module-name(source));
- write(response.output-stream,
- markup-dylan-source
- (as(<byte-string>, source-record-contents(source))));
+ output(markup-dylan-source
+ (as(<byte-string>, source-record-contents(source))));
exception(e :: <condition>)
- format(response.output-stream,
- "Source for %= unavailable because of %=\n",
+ output("Source for %= unavailable because of %=\n",
source,
e);
end block;
end for;
- format(response.output-stream, "</pre>\n");
+ output("</pre>\n");
end
end;
define tag project-used-libraries in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
-
- format(response.output-stream, "<ul>\n");
+ (page :: <code-browser-page>)
+ ()
+ output("<ul>\n");
for (library in project-used-libraries(*project*, *project*))
let name = environment-object-display-name(*project*, library, #f);
- format(response.output-stream,
- "<li><a href=\"/project?name=%s\">%s</a></li>\n",
+ output("<li><a href=\"/project?name=%s\">%s</a></li>\n",
name, name);
end for;
- format(response.output-stream, "</ul>\n");
+ output("</ul>\n");
end;
define tag project-library in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- format(response.output-stream, "%s", environment-object-display-name(*project*, project-library(*project*), #f));
+ (page :: <code-browser-page>)
+ ()
+ output("%s", environment-object-display-name(*project*,
+ project-library(*project*),
+ #f));
end;
define tag project-modules in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- format(response.output-stream, "<ul>\n");
- for (module in library-modules(*project*, project-library(*project*)))
- format(response.output-stream, "<li>%s</li>\n", environment-object-display-name(*project*, module, #f));
- end for;
- format(response.output-stream, "</ul>\n");
+ (page :: <code-browser-page>)
+ ()
+ output("<ul>\n");
+ for (module in library-modules(*project*, project-library(*project*)))
+ output("<li>%s</li>\n", environment-object-display-name(*project*, module, #f));
+ end for;
+ output("</ul>\n");
end;
define tag generic-function-object-methods in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- format(response.output-stream, "<ul>\n");
- for (m in generic-function-object-methods(*project*,
- find-environment-object(*project*, "concatenate",
- library: project-library(*project*), module: first(library-modules(*project*, project-library(*project*))))))
- format(response.output-stream, "<li>%s</li>\n", markup-dylan-source(environment-object-display-name(*project*, m, #f)));
- end;
- format(response.output-stream, "</ul>\n");
+ (page :: <code-browser-page>)
+ ()
+ output("<ul>\n");
+ for (m in generic-function-object-methods(*project*,
+ find-environment-object(*project*, "concatenate",
+ library: project-library(*project*),
+ module: first(library-modules(*project*, project-library(*project*))))))
+ output("<li>%s</li>\n",
+ markup-dylan-source(environment-object-display-name(*project*, m, #f)));
+ end;
+ output("</ul>\n");
end;
define tag clients in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- format(response.output-stream, "<ul>\n");
- for (used-definition in source-form-clients(*project*, project-library(*project*)))
- format(response.output-stream, "<li>%s</li>", markup-dylan-source(environment-object-display-name(*project*, used-definition, #f)))
- end for;
- format(response.output-stream, "</ul>\n");
+ (page :: <code-browser-page>)
+ ()
+ output("<ul>\n");
+ for (used-definition in source-form-clients(*project*, project-library(*project*)))
+ output("<li>%s</li>", markup-dylan-source(environment-object-display-name(*project*, used-definition, #f)))
+ end for;
+ output("</ul>\n");
end;
define tag project-warnings in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
- format(response.output-stream, "<ul>\n");
- for (warning in project-warnings(*project*))
- format(response.output-stream, "<li>%s</li>", markup-dylan-source(environment-object-display-name(*project*, warning, #f)))
- end for;
- format(response.output-stream, "</ul>\n");
+ (page :: <code-browser-page>)
+ ()
+ output("<ul>\n");
+ for (warning in project-warnings(*project*))
+ output("<li>%s</li>", markup-dylan-source(environment-object-display-name(*project*, warning, #f)))
+ end for;
+ output("</ul>\n");
end;
/// Main
@@ -267,10 +283,6 @@
// Starts up the web server.
define function main () => ()
*check-source-record-date?* := #f;
- let config-file =
- if(application-arguments().size > 0)
- application-arguments()[0]
- end;
populate-symbol-table();
let foo = $all-symbols["$foo"][0];
format-out("var-type %s name-type %s\n",
@@ -279,7 +291,7 @@
foo.symbol-entry-name)),
name-type(foo.symbol-entry-project,
foo.symbol-entry-name));
- start-server(config-file: config-file);
+ koala-main();
end;
define function collect-projects () => (res :: <collection>)
Modified: trunk/libraries/network/koala/sources/examples/code-browser/module-variable.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/code-browser/module-variable.dylan (original)
+++ trunk/libraries/network/koala/sources/examples/code-browser/module-variable.dylan Sat Mar 1 12:18:37 2008
@@ -3,25 +3,25 @@
Author: Andreas Bogk, Bastian Mueller, Hannes Mehnert
define tag variable-value in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
+ (page :: <code-browser-page>)
+ ()
let value = variable-value(*project*, *environment-object*);
- format(output-stream(response), "%=", value);
+ output("%=", value);
end;
define tag variable-type in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
+ (page :: <code-browser-page>)
+ ()
let type = variable-type(*project*, *environment-object*);
- format(output-stream(response), "<a href=\"%s\">%s</a>",
+ output("<a href=\"%s\">%s</a>",
do-canonical-link(type),
html-name(type));
end;
define tag thread-variable in code-browser
- (page :: <code-browser-page>, response :: <response>)
- ()
+ (page :: <code-browser-page>)
+ ()
if (instance?(*environment-object*, <thread-variable-object>))
- format(output-stream(response), "thread");
+ output("thread");
end
end;
Modified: trunk/libraries/network/koala/sources/examples/code-browser/module.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/code-browser/module.dylan (original)
+++ trunk/libraries/network/koala/sources/examples/code-browser/module.dylan Sat Mar 1 12:18:37 2008
@@ -3,8 +3,8 @@
Author: Andreas Bogk, Bastian Mueller, Hannes Mehnert
define body tag used-modules in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
do-used-definitions(method(x)
dynamic-bind(*environment-object* = x)
do-body()
@@ -13,8 +13,8 @@
end;
define body tag module-definitions in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
do-module-definitions(method(x)
dynamic-bind(*environment-object* = x)
do-body()
Modified: trunk/libraries/network/koala/sources/examples/code-browser/search.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/code-browser/search.dylan (original)
+++ trunk/libraries/network/koala/sources/examples/code-browser/search.dylan Sat Mar 1 12:18:37 2008
@@ -6,20 +6,22 @@
define thread variable *results* = #f;
define responder search-responder ("/search")
- (request, response)
let search-string = get-query-value("search");
let results = element($all-symbols, search-string, default: #());
dynamic-bind(*results* = results)
- process-template(*result-page*, request, response);
+ process-template(*result-page*);
end;
end;
-define page result-page (<code-browser-page>)
- (source: "results.dsp")
+
+define class <result-page> (<code-browser-page>)
end;
+define variable *result-page*
+ = make(<result-page>, source: "code-browser/results.dsp");
+
define body tag results in code-browser
- (page :: <code-browser-page>, response :: <response>, do-body :: <function>)
- ()
+ (page :: <code-browser-page>, do-body :: <function>)
+ ()
for (result in *results*)
dynamic-bind(*project* = result.symbol-entry-project)
dynamic-bind(*environment-object* = result.symbol-entry-name)
Modified: trunk/libraries/network/koala/sources/examples/koala-basics/library.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/koala-basics/library.dylan (original)
+++ trunk/libraries/network/koala/sources/examples/koala-basics/library.dylan Sat Mar 1 12:18:37 2008
@@ -19,7 +19,7 @@
use dylan;
use threads;
use common-extensions,
- exclude: { format-to-string, split };
+ exclude: { format-to-string };
use locators;
use format;
use streams;
Modified: trunk/libraries/network/koala/sources/examples/web-objects/library.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/web-objects/library.dylan (original)
+++ trunk/libraries/network/koala/sources/examples/web-objects/library.dylan Sat Mar 1 12:18:37 2008
@@ -10,8 +10,7 @@
end;
define module web-objects-example
- use common-dylan,
- exclude: { split };
+ use common-dylan;
use streams,
import: { write };
use dsp; // from the koala library
Modified: trunk/libraries/network/koala/sources/koala/responders.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/koala/responders.dylan (original)
+++ trunk/libraries/network/koala/sources/koala/responders.dylan Sat Mar 1 12:18:37 2008
@@ -245,7 +245,7 @@
?:body
end
}
- => { define method ?name () ?body end;
+ => { define function ?name (#key) ?body end;
add-responder(?url, ?name)
}
end macro responder-definer;
Modified: trunk/libraries/network/koala/sources/koala/server.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/koala/server.dylan (original)
+++ trunk/libraries/network/koala/sources/koala/server.dylan Sat Mar 1 12:18:37 2008
@@ -873,14 +873,13 @@
// argument so unnamed groups and the entire match can be accessed.
let arguments = #[];
if (match)
- arguments := make(<stretchy-vector>,
- size: 2 * (match.groups-by-name.size + 1));
- add!(arguments, #"match");
- add!(arguments, match);
+ arguments := make(<deque>);
+ push-last(arguments, #"match");
+ push-last(arguments, match);
for (group keyed-by name in match.groups-by-name)
if (group)
- add!(arguments, as(<symbol>, name));
- add!(arguments, group.group-text);
+ push-last(arguments, as(<symbol>, name));
+ push-last(arguments, group.group-text);
end if;
end for;
end if;
@@ -906,7 +905,14 @@
let responders = element(rmap, request.request-method, default: #f);
if (responders)
block (return)
- let url-tail = build-path(request.request-tail-url);
+ let tail-path = request.request-tail-url.uri-path;
+ // This isn't using build-path:uri:uri because we don't want it
+ // percent encoded.
+ let url-tail = if (empty?(tail-path))
+ ""
+ else
+ join(tail-path, "/")
+ end;
log-debug("url-tail: %=", url-tail);
for (actions keyed-by regex in responders)
log-debug("regex -> actions: %= -> %=", regex.regex-pattern, actions);
Modified: trunk/libraries/network/koala/sources/xml-rpc-common/library.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/xml-rpc-common/library.dylan (original)
+++ trunk/libraries/network/koala/sources/xml-rpc-common/library.dylan Sat Mar 1 12:18:37 2008
@@ -29,8 +29,7 @@
as-iso8601-string };
use xml-parser,
prefix: "xml$";
- use dylan-basics,
- exclude: { split };
+ use dylan-basics;
use base64,
import: { base64-decode };
export
Modified: trunk/libraries/network/wiki/library.dylan
==============================================================================
--- trunk/libraries/network/wiki/library.dylan (original)
+++ trunk/libraries/network/wiki/library.dylan Sat Mar 1 12:18:37 2008
@@ -27,7 +27,7 @@
define module wiki
use common-dylan,
- exclude: { split, format-to-string };
+ exclude: { format-to-string };
use locators;
use streams;
use format;
Modified: trunk/libraries/network/xml-rpc-client/library.dylan
==============================================================================
--- trunk/libraries/network/xml-rpc-client/library.dylan (original)
+++ trunk/libraries/network/xml-rpc-client/library.dylan Sat Mar 1 12:18:37 2008
@@ -18,7 +18,7 @@
define module xml-rpc-client
- use common-dylan, exclude: { format-to-string, split };
+ use common-dylan, exclude: { format-to-string };
use format;
use format-out; // for debugging only
use sockets;
Modified: trunk/libraries/network/xmpp/xmpp-test/xmpp-test-exports.dylan
==============================================================================
--- trunk/libraries/network/xmpp/xmpp-test/xmpp-test-exports.dylan (original)
+++ trunk/libraries/network/xmpp/xmpp-test/xmpp-test-exports.dylan Sat Mar 1 12:18:37 2008
@@ -10,7 +10,7 @@
end library;
define module xmpp-test
- use common-dylan, exclude: { split };
+ use common-dylan;
use format-out;
use sockets;
use streams;
Modified: trunk/libraries/uri/uri.dylan
==============================================================================
--- trunk/libraries/uri/uri.dylan (original)
+++ trunk/libraries/uri/uri.dylan Sat Mar 1 12:18:37 2008
@@ -11,7 +11,7 @@
init-keyword: host:;
slot uri-port :: false-or(<integer>) = #f,
init-keyword: port:;
- // Do you really want this to be a mutable type?
+ // Do you really want this to be a stretchy type?
slot uri-path :: <sequence> = make(<deque>),
init-keyword: path:;
// keys without values are #t
@@ -72,15 +72,10 @@
if (class == <url> & query)
query := regex-replace("\\+", query, " ");
end if;
- let (scheme, userinfo, host, path, query, fragment)
- = apply(values, map(method (slot)
- if (instance?(slot, <string>))
- percent-decode(slot)
- else
- slot
- end if;
- end,
- list(scheme, userinfo, host, path, query, fragment)));
+ if (scheme) scheme := percent-decode(scheme); end;
+ if (userinfo) userinfo := percent-decode(userinfo); end;
+ if (host) host := percent-decode(host); end;
+ if (fragment) fragment := percent-decode(fragment); end;
let uri = make(class,
scheme: scheme | "",
userinfo: userinfo | "",
@@ -88,10 +83,10 @@
port: port & string-to-integer(port),
fragment: fragment | "");
if (~empty?(path))
- uri.uri-path := split-path(path);
+ uri.uri-path := split-path(percent-decode(path));
end if;
if (query)
- uri.uri-query := split-query(query);
+ uri.uri-query := split-query(percent-decode(query));
end if;
if (absolute?(uri))
uri.uri-path := remove-dot-segments(uri.uri-path);
@@ -114,7 +109,7 @@
// split parts
define method split-path (path :: <string>) => (parts :: <sequence>);
- split(path, "/", remove-empty-items: #f);
+ split(path, "/", remove-if-empty: #f);
end;
define method split-query
@@ -199,10 +194,10 @@
for (value keyed-by key in uri.uri-query)
key := percent-encode(#"query", key, include: include);
add!(parts, if (value == #t)
- key
- else
- concatenate(key, "=", percent-encode(#"query", value, include: include));
- end if);
+ key
+ else
+ concatenate(key, "=", percent-encode(#"query", value, include: include));
+ end if);
end for;
join(parts, "&")
end if;
@@ -220,7 +215,10 @@
let encoded = "";
for (char in unencoded)
encoded := concatenate(encoded, if (member?(char, $uri-parts[part]) & ~member?(char, include))
- list(char) else percent-encode(part, char) end if);
+ list(char)
+ else
+ percent-encode(part, char)
+ end if);
end for;
encoded;
end method percent-encode;
@@ -263,7 +261,7 @@
define generic remove-dot-segments (path :: <object>) => (result :: <object>);
define method remove-dot-segments (path :: <string>) => (result :: <string>);
- let path = split(path, "/", remove-empty-items: #f);
+ let path = split(path, "/", remove-if-empty: #f);
path := remove-dot-segments(path);
join(path, "/")
end;
More information about the chatter
mailing list