guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-8-70-g215


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-8-70-g2150e9a
Date: Thu, 04 Mar 2010 12:13:47 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=2150e9a84a9e0e9f83fa7af2c08c274ebcd9b1c2

The branch, master has been updated
       via  2150e9a84a9e0e9f83fa7af2c08c274ebcd9b1c2 (commit)
       via  2b2746a831b5f74773d6eec91d2c30d43831e826 (commit)
       via  bbb2ecd1d1966766aa5f3fed7d5084b46cf1e8a7 (commit)
      from  dec84a0a6e164d7c92982ea78c27e85df56ed477 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2150e9a84a9e0e9f83fa7af2c08c274ebcd9b1c2
Author: Andy Wingo <address@hidden>
Date:   Thu Mar 4 12:02:02 2010 +0100

    partial continuations print as #<partial-continuation ...>
    
    * libguile/control.c (reify_partial_continuation):
    * libguile/programs.c (scm_i_program_print):
    * libguile/programs.h (SCM_F_PROGRAM_IS_PARTIAL_CONTINUATION)
      (SCM_PROGRAM_IS_PARTIAL_CONTINUATION): Distinguish partial
      continuations from full continuations.

commit 2b2746a831b5f74773d6eec91d2c30d43831e826
Author: Andy Wingo <address@hidden>
Date:   Thu Mar 4 11:37:03 2010 +0100

    tighten up scm_i_dowinds, fixing invalid SCM_CAR (prompt)
    
    * libguile/dynwind.c: Update comment regarding what can be on the wind
      stack.
      (scm_i_dowinds): Clean up to remove @bind and catch/throw-handler
      cases, to add a case for prompts, and to be more strict in general
      regarding the set of things that can be on the wind stack. Fixes a bug
      whereby prompts were accessed via SCM_CAR; thanks to Ken Raeburn for
      the report.

commit bbb2ecd1d1966766aa5f3fed7d5084b46cf1e8a7
Author: Andy Wingo <address@hidden>
Date:   Thu Mar 4 11:25:22 2010 +0100

    add printers for prompts and with-fluids objects
    
    * libguile/control.c:
    * libguile/control.h (scm_i_prompt_print):
    * libguile/fluids.c:
    * libguile/fluids.h (scm_i_with_fluids_print):
    * libguile/print.c (iprin1): Add printers for prompts and with-fluids
      objects.

-----------------------------------------------------------------------

Summary of changes:
 libguile/control.c  |   10 +++++++++-
 libguile/control.h  |    1 +
 libguile/dynwind.c  |   47 +++++++++++++++--------------------------------
 libguile/fluids.c   |    8 ++++++++
 libguile/fluids.h   |    1 +
 libguile/print.c    |    7 +++++++
 libguile/programs.c |    7 +++++++
 libguile/programs.h |    2 ++
 8 files changed, 50 insertions(+), 33 deletions(-)

diff --git a/libguile/control.c b/libguile/control.c
index 66962f9..7e51e1e 100644
--- a/libguile/control.c
+++ b/libguile/control.c
@@ -182,7 +182,7 @@ reify_partial_continuation (SCM vm, SCM prompt, SCM 
extwinds,
                           scm_vector (scm_list_2 (vm_cont, intwinds)),
                           SCM_BOOL_F);
   SCM_SET_CELL_WORD_0 (ret,
-                       SCM_CELL_WORD_0 (ret) | SCM_F_PROGRAM_IS_CONTINUATION);
+                       SCM_CELL_WORD_0 (ret) | 
SCM_F_PROGRAM_IS_PARTIAL_CONTINUATION);
   return ret;
 }
 
@@ -274,6 +274,14 @@ SCM_DEFINE (scm_at_abort, "@abort", 2, 0, 0, (SCM tag, SCM 
args),
 #undef FUNC_NAME
 
 void
+scm_i_prompt_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
+{
+  scm_puts ("#<prompt ", port);
+  scm_intprint (SCM_UNPACK (exp), 16, port);
+  scm_putc ('>', port);
+}
+
+void
 scm_init_control (void)
 {
 #include "libguile/control.x"
diff --git a/libguile/control.h b/libguile/control.h
index 923a45e..74a1329 100644
--- a/libguile/control.h
+++ b/libguile/control.h
@@ -56,6 +56,7 @@ SCM_INTERNAL void scm_c_abort (SCM vm, SCM tag, size_t n, SCM 
*argv,
 SCM_INTERNAL SCM scm_at_abort (SCM tag, SCM args) SCM_NORETURN;
 
 
+SCM_INTERNAL void scm_i_prompt_print (SCM exp, SCM port, scm_print_state 
*pstate);
 SCM_INTERNAL void scm_init_control (void);
 
 
diff --git a/libguile/dynwind.c b/libguile/dynwind.c
index 18e38b9..f4d19bd 100644
--- a/libguile/dynwind.c
+++ b/libguile/dynwind.c
@@ -26,6 +26,7 @@
 #include <assert.h>
 
 #include "libguile/_scm.h"
+#include "libguile/control.h"
 #include "libguile/eval.h"
 #include "libguile/alist.h"
 #include "libguile/fluids.h"
@@ -41,10 +42,9 @@
 
    #<frame>
    #<winder>
+   #<with-fluids>
+   #<prompt>
    (enter-proc . leave-proc)     dynamic-wind
-   (tag . jmpbuf)                catch
-   (tag . pre-unwind-data)       throw-handler / lazy-catch
-     tag is either a symbol or a boolean
 
 */
 
@@ -240,7 +240,6 @@ scm_i_dowinds (SCM to, long delta, void (*turn_func) (void 
*), void *data)
   else if (delta < 0)
     {
       SCM wind_elt;
-      SCM wind_key;
 
       scm_i_dowinds (SCM_CDR (to), 1 + delta, turn_func, data);
       wind_elt = SCM_CAR (to);
@@ -262,21 +261,13 @@ scm_i_dowinds (SCM to, long delta, void (*turn_func) 
(void *), void *data)
           scm_i_swap_with_fluids (wind_elt,
                                   SCM_I_CURRENT_THREAD->dynamic_state);
        }
+      else if (SCM_PROMPT_P (wind_elt))
+        ; /* pass -- see vm_reinstate_partial_continuation */
+      else if (scm_is_pair (wind_elt))
+        scm_call_0 (SCM_CAR (wind_elt));
       else
-       {
-         wind_key = SCM_CAR (wind_elt);
-         /* key = #t | symbol | thunk | list of variables */
-         if (SCM_NIMP (wind_key))
-           {
-             if (scm_is_pair (wind_key))
-               {
-                 if (SCM_VARIABLEP (SCM_CAR (wind_key)))
-                   scm_swap_bindings (wind_key, SCM_CDR (wind_elt));
-               }
-             else if (scm_is_true (scm_thunk_p (wind_key)))
-               scm_call_0 (wind_key);
-           }
-       }
+        /* trash on the wind list */
+        abort ();
 
       scm_i_set_dynwinds (to);
     }
@@ -284,7 +275,6 @@ scm_i_dowinds (SCM to, long delta, void (*turn_func) (void 
*), void *data)
     {
       SCM wind;
       SCM wind_elt;
-      SCM wind_key;
 
       wind = scm_i_dynwinds ();
       wind_elt = SCM_CAR (wind);
@@ -304,20 +294,13 @@ scm_i_dowinds (SCM to, long delta, void (*turn_func) 
(void *), void *data)
           scm_i_swap_with_fluids (wind_elt,
                                   SCM_I_CURRENT_THREAD->dynamic_state);
        }
+      else if (SCM_PROMPT_P (wind_elt))
+        ; /* pass -- though we could invalidate the prompt */
+      else if (scm_is_pair (wind_elt))
+        scm_call_0 (SCM_CDR (wind_elt));
       else
-       {
-         wind_key = SCM_CAR (wind_elt);
-         if (SCM_NIMP (wind_key))
-           {
-             if (scm_is_pair (wind_key))
-               {
-                 if (SCM_VARIABLEP (SCM_CAR (wind_key)))
-                   scm_swap_bindings (wind_key, SCM_CDR (wind_elt));
-               }
-             else if (scm_is_true (scm_thunk_p (wind_key)))
-               scm_call_0 (SCM_CDR (wind_elt));
-           }
-       }
+        /* trash on the wind list */
+        abort ();
 
       delta--;
       goto tail;               /* scm_dowinds(to, delta-1); */
diff --git a/libguile/fluids.c b/libguile/fluids.c
index d493053..765df7b 100644
--- a/libguile/fluids.c
+++ b/libguile/fluids.c
@@ -120,6 +120,14 @@ scm_i_dynamic_state_print (SCM exp, SCM port, 
scm_print_state *pstate SCM_UNUSED
   scm_putc ('>', port);
 }
 
+void
+scm_i_with_fluids_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
+{
+  scm_puts ("#<with-fluids ", port);
+  scm_intprint (SCM_UNPACK (exp), 16, port);
+  scm_putc ('>', port);
+}
+
 static size_t
 next_fluid_num ()
 {
diff --git a/libguile/fluids.h b/libguile/fluids.h
index 0d61fd2..aa01f24 100644
--- a/libguile/fluids.h
+++ b/libguile/fluids.h
@@ -92,6 +92,7 @@ SCM_INTERNAL SCM scm_i_make_initial_dynamic_state (void);
 
 SCM_INTERNAL void scm_i_fluid_print (SCM exp, SCM port, scm_print_state 
*pstate);
 SCM_INTERNAL void scm_i_dynamic_state_print (SCM exp, SCM port, 
scm_print_state *pstate);
+SCM_INTERNAL void scm_i_with_fluids_print (SCM exp, SCM port, scm_print_state 
*pstate);
 SCM_INTERNAL void scm_init_fluids (void);
 
 #endif  /* SCM_FLUIDS_H */
diff --git a/libguile/print.c b/libguile/print.c
index dcf28c7..8867e6b 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -30,6 +30,7 @@
 #include "libguile/chars.h"
 #include "libguile/continuations.h"
 #include "libguile/smob.h"
+#include "libguile/control.h"
 #include "libguile/eval.h"
 #include "libguile/macros.h"
 #include "libguile/procprop.h"
@@ -773,6 +774,12 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
        case scm_tc7_vm_cont:
          scm_i_vm_cont_print (exp, port, pstate);
          break;
+       case scm_tc7_prompt:
+         scm_i_prompt_print (exp, port, pstate);
+         break;
+       case scm_tc7_with_fluids:
+         scm_i_with_fluids_print (exp, port, pstate);
+         break;
        case scm_tc7_wvect:
          ENTER_NESTED_DATA (pstate, exp, circref);
          if (SCM_IS_WHVEC (exp))
diff --git a/libguile/programs.c b/libguile/programs.c
index 8ce9fe1..c80648e 100644
--- a/libguile/programs.c
+++ b/libguile/programs.c
@@ -86,6 +86,13 @@ scm_i_program_print (SCM program, SCM port, scm_print_state 
*pstate)
       scm_uintprint (SCM_UNPACK (program), 16, port);
       scm_putc ('>', port);
     }
+  if (SCM_PROGRAM_IS_PARTIAL_CONTINUATION (program))
+    {
+      /* twingliness */
+      scm_puts ("#<partial-continuation ", port);
+      scm_uintprint (SCM_UNPACK (program), 16, port);
+      scm_putc ('>', port);
+    }
   else if (scm_is_false (write_program) || print_error)
     {
       scm_puts ("#<program ", port);
diff --git a/libguile/programs.h b/libguile/programs.h
index 2611550..c8e3bf6 100644
--- a/libguile/programs.h
+++ b/libguile/programs.h
@@ -30,6 +30,7 @@
 #define SCM_F_PROGRAM_IS_PRIMITIVE 0x200
 #define SCM_F_PROGRAM_IS_PRIMITIVE_GENERIC 0x400
 #define SCM_F_PROGRAM_IS_CONTINUATION 0x800
+#define SCM_F_PROGRAM_IS_PARTIAL_CONTINUATION 0x1000
 
 #define SCM_PROGRAM_P(x)       (!SCM_IMP (x) && SCM_TYP7(x) == scm_tc7_program)
 #define SCM_PROGRAM_OBJCODE(x) (SCM_CELL_OBJECT_1 (x))
@@ -44,6 +45,7 @@
 #define SCM_PROGRAM_IS_PRIMITIVE(x) (SCM_CELL_WORD_0 (x) & 
SCM_F_PROGRAM_IS_PRIMITIVE)
 #define SCM_PROGRAM_IS_PRIMITIVE_GENERIC(x) (SCM_CELL_WORD_0 (x) & 
SCM_F_PROGRAM_IS_PRIMITIVE_GENERIC)
 #define SCM_PROGRAM_IS_CONTINUATION(x) (SCM_CELL_WORD_0 (x) & 
SCM_F_PROGRAM_IS_CONTINUATION)
+#define SCM_PROGRAM_IS_PARTIAL_CONTINUATION(x) (SCM_CELL_WORD_0 (x) & 
SCM_F_PROGRAM_IS_PARTIAL_CONTINUATION)
 
 SCM_API SCM scm_make_program (SCM objcode, SCM objtable, SCM free_variables);
 


hooks/post-receive
-- 
GNU Guile




reply via email to

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