[Gd-chatter] r11082 - in trunk/src: common/table-ext tools/melange tools/pidgin/src
agent at gwydiondylan.org
agent at gwydiondylan.org
Wed Dec 20 08:24:24 CET 2006
Author: agent
Date: Wed Dec 20 08:24:21 2006
New Revision: 11082
Modified:
trunk/src/common/table-ext/table-extensions-library.dylan
trunk/src/common/table-ext/table-extensions.dylan
trunk/src/tools/melange/c-exports.dylan
trunk/src/tools/pidgin/src/ansi-c-exports.dylan
Log:
Job: gd
Checked in table macro into table-extensions, and necessary build fixes.
Modified: trunk/src/common/table-ext/table-extensions-library.dylan
==============================================================================
--- trunk/src/common/table-ext/table-extensions-library.dylan (original)
+++ trunk/src/common/table-ext/table-extensions-library.dylan Wed Dec 20 08:24:21 2006
@@ -42,6 +42,7 @@
<equal-table>, equal-hash, <value-table>, value-hash};
export
+ table,
<string-table>, <byte-string-table>,
<case-insensitive-string-table>, <case-insensitive-byte-string-table>,
values-hash,
Modified: trunk/src/common/table-ext/table-extensions.dylan
==============================================================================
--- trunk/src/common/table-ext/table-extensions.dylan (original)
+++ trunk/src/common/table-ext/table-extensions.dylan Wed Dec 20 08:24:21 2006
@@ -29,6 +29,26 @@
//======================================================================
+// Table constructor. Syntax:
+// let my-table = table("red"=>"stop", "green"=>"go");
+// let my-table = table(<string-table>, "red"=>"stop", "green"=>"go");
+//
+define macro table
+
+ // Matches when optional class included.
+ { table(?table-class:expression, ?table-contents) }
+ => { let ht = make(?table-class); ?table-contents; ht; }
+
+ // Matches without optional class.
+ { table(?rest:*) } => { table(<table>, ?rest); }
+
+ table-contents:
+ { } => { }
+ { ?key:expression => ?value:expression, ... }
+ => { ht[?key] := ?value; ... }
+end macro table;
+
+
// A value table whose keys are strings.
//
define sealed class <string-table> (<value-table>)
Modified: trunk/src/tools/melange/c-exports.dylan
==============================================================================
--- trunk/src/tools/melange/c-exports.dylan (original)
+++ trunk/src/tools/melange/c-exports.dylan Wed Dec 20 08:24:21 2006
@@ -190,7 +190,7 @@
define module c-declarations
use common-dylan, exclude: { format-to-string, split };
- use table-extensions;
+ use table-extensions, rename: { table => make-table };
use regular-expressions;
use streams;
use file-system;
Modified: trunk/src/tools/pidgin/src/ansi-c-exports.dylan
==============================================================================
--- trunk/src/tools/pidgin/src/ansi-c-exports.dylan (original)
+++ trunk/src/tools/pidgin/src/ansi-c-exports.dylan Wed Dec 20 08:24:21 2006
@@ -15,7 +15,9 @@
define module outside-dependencies
use dylan, export: all;
use extensions, export: all;
- use table-extensions, export: all;
+ use table-extensions,
+ rename: { table => make-table },
+ export: all;
use format,
import: {format-to-string},
export: all;
More information about the chatter
mailing list