chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] deprecate "constant" declaration, document "pu


From: Felix
Subject: [Chicken-hackers] [PATCH] deprecate "constant" declaration, document "pure"
Date: Tue, 13 Sep 2011 10:21:58 +0200 (CEST)

Attached is a patch that adds documentation for the "pure"
declaration, which declares a toplevel identifier to name
a procedure that is free of side effects (and thus calls to it
may be eliminated). This declaration was previously named
"constant", which is now deprecated.


cheers,
felix
commit 397219495718e3e0723e36ae86810d4601223c3a
Author: felix <address@hidden>
Date:   Tue Sep 13 10:11:28 2011 +0200

    - marked "constant" declaration as deprecated
    - documented "pure" declaration, which is a synonym for the deprecated 
"constant"
      declaration

diff --git a/compiler.scm b/compiler.scm
index 92529ce..fef3bb7 100644
--- a/compiler.scm
+++ b/compiler.scm
@@ -1467,7 +1467,8 @@
              (warning 
               "invalid argument to `inline-limit' declaration"
               spec) ) ) )
-       ((constant pure)                        ;XXX "pure" is undocumented
+       ((constant                      ; DEPRECATED
+        pure)
        (let ((syms (cdr spec)))
          (if (every symbol? syms)
              (for-each 
diff --git a/manual/Declarations b/manual/Declarations
index 74d4d5d..de40a09 100644
--- a/manual/Declarations
+++ b/manual/Declarations
@@ -61,14 +61,6 @@ Declares that the given identifiers are always bound to 
procedure values.
 Enables or disables syntax-checking of embedded C/C++ code fragments. Checking 
C syntax is the default.
 
 
-=== constant
-
- [declaration specifier] (constant IDENTIFIER ...)
-
-Declares the procedures with the names {{IDENTIFIER ...}} as constant, that 
is, as not having any
-side effects. This can help the compiler to remove non-side-effecting 
expressions.
-
-
 === enforce-argument-types
 
  [declaration-specifier] (enforce-argument-types IDENTIFIER ...)
@@ -233,6 +225,16 @@ enables profiling decorations for all globally defined 
procedures. With
 this declaration, profiling can be enabled for selected procedures.
 
 
+=== pure
+
+ [declaration specifier] (pure IDENTIFIER ...)
+
+Declares the procedures with the names {{IDENTIFIER ...}} as
+referentially transparent, that is, as not having any side
+effects. This can help the compiler to remove non-side-effecting
+expressions.
+
+
 === number-type
 === fixnum-arithmetic
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]