[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: specification by implications and example

This page is part of the web mail archives of SRFI 17 from before July 7th, 2015. The new archives for SRFI 17 contain all messages, not just those from before July 7th, 2015.



Matthias Felleisen <matthias@xxxxxxxxxxx> writes:

> Now this really raises the question about a formal specification. Could you
> please provide a specification of the syntax and semantics of this stuff? I
> would be happy with an operational semantics (i.e. an implementation in a
> Scheme with define-syntax) or a rewriting model or an extension of the
> denotational model or a definitional interpreter. (I am not teasing, I am
> just curious. I can imagine a model in each framework, but there are so
> many variations I can think of that I don't know how one could possibly
> specify a SRFI w/o doing that much.)

How about this change to the SRFI?  Could the Editors install this change,
assuming they don't find any mistakes?

--- srfi-17.html	Sun Jan 16 17:46:20 2000
+++ srfi-17.html.new	Sun Jan 16 17:45:11 2000
@@ -155,6 +155,22 @@
 is more intuitive, and has the big advantage that many
 existing functions already have proper setters.
 My tentative recommendation is alternative 1.
+<p>
+The formal definition is thus:
+<pre>
+(define-syntax set!
+  (syntax-rules ()
+    ((set! (proc arg ...) value)  ;; Assuming Alternative 1
+     ((setter proc) arg ... value))
+    ;; ((set! (proc arg ...) value) ;; Assuming Alternative 2
+    ;;  ((setter proc) value arg ...))
+    ((set! var value)
+     (%%builtin-set! var value))))
+</pre>
+- where <code>%%builtin-set!</code> is the R5RS version of <code>set!</code>,
+and <code>setter</code> is a new standard procedure that maps procedures
+to their setters.  If the procedure has no setter, then <code>setter</code>
+signals an error.
 
 <h2>Standard setters</h2>
 <p>
@@ -301,7 +317,7 @@
     <address>Editor: <a href="mailto:srfi-editors@xxxxxxxxxxxx";>Mike Sperber</a></address>
 <!-- Created: Wed Nov 10 03:14:43 PST 1999 -->
 <!-- hhmts start -->
-Last modified: Sun Jan 16 10:45:36 MET 2000
+Last modified: Sun Jan 16 17:45:11 PST 2000
 <!-- hhmts end -->
   </body>
 </html>

-- 
	--Per Bothner
per@xxxxxxxxxxx   http://www.bothner.com/~per/