guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, subr-simplification, updated. release_


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, subr-simplification, updated. release_1-9-5-90-gbf5a05f
Date: Thu, 03 Dec 2009 15:02:02 +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=bf5a05f2a01fee23f5622d1429dc32f4850f98b5

The branch, subr-simplification has been updated
       via  bf5a05f2a01fee23f5622d1429dc32f4850f98b5 (commit)
       via  a941cde9e595ab13f4d1804a2734967a89ead03a (commit)
      from  d389e9661a682855e8313b37a4f08dd2d7735acc (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 -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 libguile/eval.c |   38 ++++++++------------------------------
 libguile/vm.c   |   34 ++++++++--------------------------
 2 files changed, 16 insertions(+), 56 deletions(-)

diff --git a/libguile/eval.c b/libguile/eval.c
index 8a47008..b68c0ca 100644
--- a/libguile/eval.c
+++ b/libguile/eval.c
@@ -543,56 +543,34 @@ SCM_DEFINE (scm_evaluator_traps, 
"evaluator-traps-interface", 0, 1, 0,
 SCM
 scm_call_0 (SCM proc)
 {
-  if (SCM_PROGRAM_P (proc))
-    return scm_c_vm_run (scm_the_vm (), proc, NULL, 0);
-  else
-    return scm_apply (proc, SCM_EOL, SCM_EOL);
+  return scm_c_vm_run (scm_the_vm (), proc, NULL, 0);
 }
 
 SCM
 scm_call_1 (SCM proc, SCM arg1)
 {
-  if (SCM_PROGRAM_P (proc))
-    return scm_c_vm_run (scm_the_vm (), proc, &arg1, 1);
-  else
-    return scm_apply (proc, arg1, scm_listofnull);
+  return scm_c_vm_run (scm_the_vm (), proc, &arg1, 1);
 }
 
 SCM
 scm_call_2 (SCM proc, SCM arg1, SCM arg2)
 {
-  if (SCM_PROGRAM_P (proc))
-    {
-      SCM args[] = { arg1, arg2 };
-      return scm_c_vm_run (scm_the_vm (), proc, args, 2);
-    }
-  else
-    return scm_apply (proc, arg1, scm_cons (arg2, scm_listofnull));
+  SCM args[] = { arg1, arg2 };
+  return scm_c_vm_run (scm_the_vm (), proc, args, 2);
 }
 
 SCM
 scm_call_3 (SCM proc, SCM arg1, SCM arg2, SCM arg3)
 {
-  if (SCM_PROGRAM_P (proc))
-    {
-      SCM args[] = { arg1, arg2, arg3 };
-      return scm_c_vm_run (scm_the_vm (), proc, args, 3);
-    }
-  else
-    return scm_apply (proc, arg1, scm_cons2 (arg2, arg3, scm_listofnull));
+  SCM args[] = { arg1, arg2, arg3 };
+  return scm_c_vm_run (scm_the_vm (), proc, args, 3);
 }
 
 SCM
 scm_call_4 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4)
 {
-  if (SCM_PROGRAM_P (proc))
-    {
-      SCM args[] = { arg1, arg2, arg3, arg4 };
-      return scm_c_vm_run (scm_the_vm (), proc, args, 4);
-    }
-  else
-    return scm_apply (proc, arg1, scm_cons2 (arg2, arg3,
-                                             scm_cons (arg4, scm_listofnull)));
+  SCM args[] = { arg1, arg2, arg3, arg4 };
+  return scm_c_vm_run (scm_the_vm (), proc, args, 4);
 }
 
 /* Simple procedure applies
diff --git a/libguile/vm.c b/libguile/vm.c
index 67b5614..fdfae00 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -265,27 +265,8 @@ resolve_variable (SCM what, SCM program_module)
 static SCM
 apply_foreign (SCM proc, SCM *args, int nargs, int headroom)
 {
-  SCM arg1, arg2, arg3;
-
   SCM_ASRTGO (SCM_NIMP (proc), badproc);
 
-  /* Parse args. */
-  switch (nargs)
-    {
-    case 0:
-      arg1 = SCM_UNDEFINED; arg2 = SCM_UNDEFINED; arg3 = SCM_UNDEFINED;
-      break;
-    case 1:
-      arg1 = args[0]; arg2 = SCM_UNDEFINED; arg3 = SCM_UNDEFINED;
-      break;
-    case 2:
-      arg1 = args[0]; arg2 = args[1]; arg3 = SCM_UNDEFINED;
-      break;
-    default:
-      arg1 = args[0]; arg2 = args[1]; arg3 = args[2];
-      break;
-    }
-
   switch (SCM_TYP7 (proc))
     {
     case scm_tcs_closures:
@@ -298,15 +279,16 @@ apply_foreign (SCM proc, SCM *args, int nargs, int 
headroom)
       }
     case scm_tc7_cxr:
       if (nargs != 1) scm_wrong_num_args (proc);
-      return scm_i_chase_pairs (arg1, (scm_t_bits) SCM_SUBRF (proc));
+      return scm_i_chase_pairs (args[0], (scm_t_bits) SCM_SUBRF (proc));
     case scm_tc7_asubr:
       if (nargs < 2)
-        return SCM_SUBRF (proc) (arg1, SCM_UNDEFINED);
+        return SCM_SUBRF (proc) (args[0], SCM_UNDEFINED);
       {
+        SCM x = args[0];
         int idx = 1;
         while (nargs-- > 1)
-          arg1 = SCM_SUBRF (proc) (arg1, args[idx++]);
-        return arg1;
+          x = SCM_SUBRF (proc) (x, args[idx++]);
+        return x;
       }
     case scm_tc7_rpsubr:
       {
@@ -326,15 +308,15 @@ apply_foreign (SCM proc, SCM *args, int nargs, int 
headroom)
         case 0:
           return SCM_SMOB_APPLY_0 (proc);
         case 1:
-          return SCM_SMOB_APPLY_1 (proc, arg1);
+          return SCM_SMOB_APPLY_1 (proc, args[0]);
         case 2:
-          return SCM_SMOB_APPLY_2 (proc, arg1, arg2);
+          return SCM_SMOB_APPLY_2 (proc, args[0], args[1]);
         default:
           {
             SCM arglist = SCM_EOL;
             while (nargs-- > 2)
               arglist = scm_cons (args[nargs], arglist);
-            return SCM_SMOB_APPLY_3 (proc, arg1, arg2, arglist);
+            return SCM_SMOB_APPLY_3 (proc, args[0], args[1], arglist);
           }
         }
     case scm_tc7_gsubr:


hooks/post-receive
-- 
GNU Guile




reply via email to

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