[Gd-chatter] r11335 - in trunk/demonstration: . sealing-rule-3 sealing-rule-3/a sealing-rule-3/b sealing-rule-3/c
prom at gwydiondylan.org
prom at gwydiondylan.org
Tue May 8 10:00:52 CEST 2007
Author: prom
Date: Tue May 8 10:00:50 2007
New Revision: 11335
Added:
trunk/demonstration/
trunk/demonstration/README (contents, props changed)
trunk/demonstration/sealing-rule-3/
trunk/demonstration/sealing-rule-3/README (contents, props changed)
trunk/demonstration/sealing-rule-3/a/
trunk/demonstration/sealing-rule-3/a/Makefile (contents, props changed)
trunk/demonstration/sealing-rule-3/a/a-exports.dylan (contents, props changed)
trunk/demonstration/sealing-rule-3/a/a.dylan (contents, props changed)
trunk/demonstration/sealing-rule-3/a/a.lid (contents, props changed)
trunk/demonstration/sealing-rule-3/b/
trunk/demonstration/sealing-rule-3/b/Makefile (contents, props changed)
trunk/demonstration/sealing-rule-3/b/b-exports.dylan (contents, props changed)
trunk/demonstration/sealing-rule-3/b/b.dylan (contents, props changed)
trunk/demonstration/sealing-rule-3/b/b.lid (contents, props changed)
trunk/demonstration/sealing-rule-3/c/
trunk/demonstration/sealing-rule-3/c/Makefile (contents, props changed)
trunk/demonstration/sealing-rule-3/c/c-exports.dylan (contents, props changed)
trunk/demonstration/sealing-rule-3/c/c.dylan (contents, props changed)
trunk/demonstration/sealing-rule-3/c/c.lid (contents, props changed)
Log:
Job: minor
Added a small demonstration for sealing rule 3.
This is material for bugzilla ticket #10.
Added: trunk/demonstration/README
==============================================================================
--- (empty file)
+++ trunk/demonstration/README Tue May 8 10:00:50 2007
@@ -0,0 +1,4 @@
+
+This directory contains code that is meant to demonstrate things
+about dylan, bugs and similar things. It is meant as a temporary
+holding area for such things.
Added: trunk/demonstration/sealing-rule-3/README
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/README Tue May 8 10:00:50 2007
@@ -0,0 +1,13 @@
+
+These three libraries demonstrate rule 3 of the sealing rules as specified in the DRM.
+
+<put real explanation here>
+
+to compile:
+
+pushd a; make; popd;
+pushd b; make; popd;
+pushd c; make; popd;
+
+If compiling C fails, the dylan compiler correctly enforces rule 3.
+If it compiles and runs, the compiler does not enforce rule 3.
Added: trunk/demonstration/sealing-rule-3/a/Makefile
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/a/Makefile Tue May 8 10:00:50 2007
@@ -0,0 +1,9 @@
+a.lib.du: a.lid a.dylan a-exports.dylan
+ d2c a.lid
+
+clean:
+ -rm -f *.lo *.o *.s *.la *.a *.c *.mak *~ a.lib.du
+ -rm -rf .libs
+
+install: a.lib.du
+ libtool /usr/bin/install -c liba.a a.lib.du `d2c --dylan-user-location`
Added: trunk/demonstration/sealing-rule-3/a/a-exports.dylan
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/a/a-exports.dylan Tue May 8 10:00:50 2007
@@ -0,0 +1,15 @@
+module: dylan-user
+
+define library a
+ use common-dylan;
+ use io;
+
+ export a;
+end library;
+
+define module a
+ use common-dylan;
+ use format-out;
+
+ export <s>, <t>, m;
+end module;
Added: trunk/demonstration/sealing-rule-3/a/a.dylan
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/a/a.dylan Tue May 8 10:00:50 2007
@@ -0,0 +1,17 @@
+module: a
+synopsis:
+author:
+copyright:
+
+define open generic m(x);
+
+define open class <t> (<object>)
+end;
+
+define open class <s> (<object>)
+end;
+
+define method m (s :: <s>)
+end;
+
+define sealed domain m(<t>);
Added: trunk/demonstration/sealing-rule-3/a/a.lid
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/a/a.lid Tue May 8 10:00:50 2007
@@ -0,0 +1,4 @@
+library: a
+files:
+ a-exports
+ a
Added: trunk/demonstration/sealing-rule-3/b/Makefile
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/b/Makefile Tue May 8 10:00:50 2007
@@ -0,0 +1,9 @@
+b.lib.du: b.lid b.dylan b-exports.dylan
+ d2c -L../a/ b.lid
+
+clean:
+ -rm -f *.lo *.o *.s *.la *.a *.c *.mak *~ b.lib.du
+ -rm -rf .libs
+
+install: b.lib.du
+ libtool /usr/bin/install -c libb.a b.lib.du `d2c --dylan-user-location`
Added: trunk/demonstration/sealing-rule-3/b/b-exports.dylan
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/b/b-exports.dylan Tue May 8 10:00:50 2007
@@ -0,0 +1,17 @@
+module: dylan-user
+
+define library b
+ use common-dylan;
+ use io;
+ use a;
+
+ export b;
+end library;
+
+define module b
+ use common-dylan;
+ use format-out;
+ use a;
+
+ export <c>;
+end module;
Added: trunk/demonstration/sealing-rule-3/b/b.dylan
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/b/b.dylan Tue May 8 10:00:50 2007
@@ -0,0 +1,10 @@
+module: b
+synopsis:
+author:
+copyright:
+
+define class <c> (<s>, <t>)
+end;
+
+define method m(c :: <c>)
+end;
Added: trunk/demonstration/sealing-rule-3/b/b.lid
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/b/b.lid Tue May 8 10:00:50 2007
@@ -0,0 +1,4 @@
+library: b
+files:
+ b-exports
+ b
Added: trunk/demonstration/sealing-rule-3/c/Makefile
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/c/Makefile Tue May 8 10:00:50 2007
@@ -0,0 +1,6 @@
+c: c.lid c.dylan c-exports.dylan
+ d2c -L../a/ -L../b/ c.lid
+
+clean:
+ -rm -f *.lo *.o *.s *.la *.a *.c *.mak *.el *~ c c.lib.du
+ -rm -rf .libs
Added: trunk/demonstration/sealing-rule-3/c/c-exports.dylan
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/c/c-exports.dylan Tue May 8 10:00:50 2007
@@ -0,0 +1,15 @@
+module: dylan-user
+
+define library c
+ use common-dylan;
+ use io;
+ use a;
+ use b;
+end library;
+
+define module c
+ use common-dylan;
+ use format-out;
+ use a;
+ use b;
+end module;
Added: trunk/demonstration/sealing-rule-3/c/c.dylan
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/c/c.dylan Tue May 8 10:00:50 2007
@@ -0,0 +1,20 @@
+module: c
+synopsis:
+author:
+copyright:
+
+begin
+ local method analyze(c :: <class>)
+ let i = make(c);
+ format-out("instance of %=, %= results in: ", c, i);
+ block ()
+ m(i);
+ format-out(".\n");
+ exception (e :: <error>)
+ format-out(" exception %=\n", e);
+ end;
+ end;
+
+
+ map(analyze, list(<s>, <t>, <c>));
+end;
Added: trunk/demonstration/sealing-rule-3/c/c.lid
==============================================================================
--- (empty file)
+++ trunk/demonstration/sealing-rule-3/c/c.lid Tue May 8 10:00:50 2007
@@ -0,0 +1,4 @@
+library: c
+executable: c
+files: c-exports
+ c
More information about the chatter
mailing list