pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] pspp ./NEWS ./TODO ./pspp-mode.el doc/data-sele...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp ./NEWS ./TODO ./pspp-mode.el doc/data-sele...
Date: Sat, 06 May 2006 20:27:23 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Branch:         
Changes by:     Ben Pfaff <address@hidden>      06/05/06 20:27:23

Modified files:
        .              : NEWS TODO pspp-mode.el 
        doc            : data-selection.texi 
        src/data       : ChangeLog procedure.c variable.h 
        src/language   : ChangeLog command.def 
        src/language/expressions: helpers.h 
        src/language/xforms: ChangeLog select-if.c 
        src/math       : sort.c 

Log message:
        Continue reforming procedure execution.  In this phase, remove PROCESS
        IF, which was deprecated anyway and can be easily simulated with
        TEMPORARY followed by SELECT IF.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/NEWS.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/TODO.diff?tr1=1.40&tr2=1.41&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/pspp-mode.el.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/doc/data-selection.texi.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/ChangeLog.diff?tr1=1.34&tr2=1.35&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/procedure.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/variable.h.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/ChangeLog.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/command.def.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/expressions/helpers.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/xforms/ChangeLog.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/language/xforms/select-if.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/math/sort.c.diff?tr1=1.8&tr2=1.9&r1=text&r2=text

Patches:
Index: pspp/NEWS
diff -u pspp/NEWS:1.15 pspp/NEWS:1.16
--- pspp/NEWS:1.15      Tue May  2 03:51:42 2006
+++ pspp/NEWS   Sat May  6 20:27:23 2006
@@ -1,5 +1,5 @@
 PSPP NEWS -- history of user-visible changes.
-Time-stamp: <2006-04-03 10:56:18 blp>
+Time-stamp: <2006-05-06 13:24:08 blp>
 Copyright (C) 1996-9, 2000 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -7,6 +7,9 @@
 
 Changes since 0.4.2:
 
+  The PROCESS IF command, which was deprecated, has been removed.  You
+  may replace any usage of it by SELECT IF following TEMPORARY, which
+  has the same effect.
 
 Changes since 0.4.0 to 0.4.1:
 
Index: pspp/TODO
diff -u pspp/TODO:1.40 pspp/TODO:1.41
--- pspp/TODO:1.40      Sat May  6 18:03:30 2006
+++ pspp/TODO   Sat May  6 20:27:23 2006
@@ -1,4 +1,4 @@
-Time-stamp: <2006-05-06 11:03:32 blp>
+Time-stamp: <2006-05-06 11:38:03 blp>
 
 Procedure processing:
 
@@ -6,7 +6,7 @@
 
 * LAG need not be as much of a special case.
 
-* Push PROCESS IF, FILTER, N OF CASES out of procedure.c.
+* Push FILTER, N OF CASES out of procedure.c.
 
 * Change sources into state machines?
 
@@ -86,7 +86,7 @@
 3. Write case to replacement active file.
 4. Execute temporary transformations.  If these drop the case, stop.
 5. Post-TEMPORARY N OF CASES.  If we have already analyzed N cases, stop.
-6. FILTER, PROCESS IF.  If these drop the case, stop.
+6. FILTER.  If this drops the case, stop.
 7. Pass case to procedure.
 
 Ugly cases:
@@ -98,7 +98,7 @@
 because AGGREGATE creates its own case sink and writes to it in step 7.  Also,
 TEMPORARY has no effect and we just cancel it.  Regardless of direction of
 output, we should not implement AGGREGATE through a transformation because that
-will fail to honor FILTER, PROCESS IF, N OF CASES.
+will fail to honor FILTER, N OF CASES.
 
 ADD FILES: Essentially an input program.  It silently cancels unclosed LOOPs
 and DO IFs.  If the active file is used for input, then runs EXECUTE (if there
@@ -147,14 +147,6 @@
   * Before TEMPORARY, selection is permanent.  After TEMPORARY,
     selection stops after a procedure.
 
-PROCESS IF
-
-  * Always selects cases sent to the procedure.
-
-  * No effect on cases sent to sink.
-
-  * Always stops after a procedure.
-
 SPLIT FILE
 
   * Ignored by AGGREGATE.  Used when procedures write matrices.
@@ -180,7 +172,7 @@
 
   * RENAME VARIABLES is invalid after TEMPORARY.
 
-  * WEIGHT, SPLIT FILE, N OF CASES, FILTER, PROCESS IF apply only to
+  * WEIGHT, SPLIT FILE, N OF CASES, FILTER apply only to
     the next procedure when used after TEMPORARY.
 
 WEIGHT
Index: pspp/doc/data-selection.texi
diff -u pspp/doc/data-selection.texi:1.4 pspp/doc/data-selection.texi:1.5
--- pspp/doc/data-selection.texi:1.4    Sun Mar 13 01:04:36 2005
+++ pspp/doc/data-selection.texi        Sat May  6 20:27:23 2006
@@ -7,7 +7,6 @@
 @menu
 * FILTER::                      Exclude cases based on a variable.
 * N OF CASES::                  Limit the size of the active file.
-* PROCESS IF::                  Temporarily excluding cases.
 * SAMPLE::                      Select a specified proportion of cases.
 * SELECT IF::                   Permanently delete selected cases.
 * SPLIT FILE::                  Do multiple analyses with one command.
@@ -44,7 +43,7 @@
 OFF}.  However, if @cmd{FILTER} is placed after TEMPORARY, it filters only
 the next procedure or procedure-like command.
 
address@hidden N OF CASES, PROCESS IF, FILTER, Data Selection
address@hidden N OF CASES
 @section N OF CASES
 @vindex N OF CASES
 
@@ -70,7 +69,7 @@
 Transformation procedures performed after @cmd{N} is executed
 @emph{do} cause cases to be discarded.
 
address@hidden, @cmd{PROCESS IF}, and @cmd{SELECT IF} have
address@hidden and @cmd{SELECT IF} have
 precedence over @cmd{N}---the same results are obtained by both of the
 following fragments, given the same random number seeds:
 
@@ -98,41 +97,7 @@
 When @cmd{N} is specified after @cmd{TEMPORARY}, it affects only
 the next procedure (@pxref{TEMPORARY}).
 
address@hidden PROCESS IF, SAMPLE, N OF CASES, Data Selection
address@hidden PROCESS IF
address@hidden PROCESS IF
-
address@hidden
-PROCESS IF expression.
address@hidden example
-
address@hidden IF} temporarily eliminates cases from the
-data stream.  Its effects are active only through the execution of the
-next procedure or procedure-like command.
-
-Specify a boolean expression (@pxref{Expressions}).  If the value of the
-expression is true for a particular case, the case will be analyzed.  If
-the expression has a false or missing value, then the case will be
-deleted from the data stream for this procedure only.
-
-Regardless of its placement relative to other commands, @cmd{PROCESS IF}
-always takes effect immediately before data passes to the procedure.
-Only one @cmd{PROCESS IF} command may be in effect at any given time.
-
-The effects of @cmd{PROCESS IF} are similar, but not identical, to the
-effects of executing @cmd{TEMPORARY}, then @cmd{SELECT IF}
-(@pxref{SELECT IF}).
-
-The filtering performed by @cmd{PROCESS IF} takes place immediately
-before cases pass to a procedure for analysis.  Because @cmd{PROCESS
-IF} affects only a single procedure, its placement relative to
address@hidden is unimportant.
-
address@hidden IF} is deprecated.  It is included for compatibility with
-old command files.  New syntax files should use @cmd{SELECT IF} or
address@hidden instead.
-
address@hidden SAMPLE, SELECT IF, PROCESS IF, Data Selection
address@hidden SAMPLE
 @section SAMPLE
 @vindex SAMPLE
 
Index: pspp/pspp-mode.el
diff -u pspp/pspp-mode.el:1.4 pspp/pspp-mode.el:1.5
--- pspp/pspp-mode.el:1.4       Sat May  7 09:30:31 2005
+++ pspp/pspp-mode.el   Sat May  6 20:27:23 2006
@@ -389,7 +389,6 @@
                                "PRINT FORMATS"          
                                "PRINT SPACE"            
                                "PROCEDURE OUTPUT"       
-                               "PROCESS IF"             
                                "PROXIMITIES"            
                                "Q"                      
                                "QUICK CLUSTER"          
Index: pspp/src/data/ChangeLog
diff -u pspp/src/data/ChangeLog:1.34 pspp/src/data/ChangeLog:1.35
--- pspp/src/data/ChangeLog:1.34        Sat May  6 18:01:13 2006
+++ pspp/src/data/ChangeLog     Sat May  6 20:27:23 2006
@@ -1,3 +1,17 @@
+Sat May  6 12:38:55 2006  Ben Pfaff  <address@hidden>
+
+       Continue reforming procedure execution.  In this phase, remove
+       PROCESS IF, which was deprecated anyway and can be easily
+       simulated with TEMPORARY followed by SELECT IF.
+
+       * procedure.c: (open_active_file) Don't call
+       add_process_if_trns().
+       (discard_variables) Get rid of redundant call to
+       proc_cancel_all_transformations().
+       (add_process_if_trns) Removed.
+       (process_if_trns_proc) Removed.
+       (process_if_trns_free) Removed.
+
 Sat May  6 10:58:05 2006  Ben Pfaff  <address@hidden>
 
        Continue reforming procedure execution.  In this phase, add
Index: pspp/src/data/procedure.c
diff -u pspp/src/data/procedure.c:1.5 pspp/src/data/procedure.c:1.6
--- pspp/src/data/procedure.c:1.5       Sat May  6 18:01:13 2006
+++ pspp/src/data/procedure.c   Sat May  6 20:27:23 2006
@@ -34,7 +34,6 @@
 #include <data/storage-stream.h>
 #include <data/transformations.h>
 #include <data/variable.h>
-#include <language/expressions/public.h>
 #include <libpspp/alloc.h>
 #include <libpspp/misc.h>
 #include <libpspp/str.h>
@@ -94,7 +93,6 @@
 
 static void add_case_limit_trns (void);
 static void add_filter_trns (void);
-static void add_process_if_trns (void);
 
 static bool internal_procedure (bool (*case_func) (const struct ccase *,
                                                    void *),
@@ -220,8 +218,6 @@
       && trns_chain_is_empty (permanent_trns_chain))
     {
       n_lag = 0;
-      expr_free (process_if_expr);
-      process_if_expr = NULL;
       dict_set_case_limit (default_dict, 0);
       dict_clear_vectors (default_dict);
       return true;
@@ -285,7 +281,6 @@
 {
   add_case_limit_trns ();
   add_filter_trns ();
-  add_process_if_trns ();
 
   /* Finalize transformations. */
   trns_chain_finalize (cur_trns_chain);
@@ -443,8 +438,6 @@
   free_case_sink (vfm_sink);
   vfm_sink = NULL;
 
-  /* Cancel TEMPORARY, PROCESS IF, FILTER, N OF CASES, vectors,
-     and get rid of all the transformations. */
   dict_clear_vectors (default_dict);
   permanent_dict = NULL;
   return proc_cancel_all_transformations ();
@@ -677,11 +670,6 @@
   vfm_source = NULL;
 
   proc_cancel_all_transformations ();
-
-  expr_free (process_if_expr);
-  process_if_expr = NULL;
-
-  proc_cancel_temporary_transformations ();
 }
 
 /* Returns the current set of permanent transformations,
@@ -943,40 +931,4 @@
   return (f != 0.0 && !mv_is_num_missing (&filter_var->miss, f)
           ? TRNS_CONTINUE : TRNS_DROP_CASE);
 }
-
-static trns_proc_func process_if_trns_proc;
-static trns_free_func process_if_trns_free;
-
-/* Adds a temporary transformation to filter data according to
-   the expression specified on PROCESS IF, if any. */
-static void
-add_process_if_trns (void) 
-{
-  if (process_if_expr != NULL) 
-    {
-      proc_start_temporary_transformations ();
-      add_transformation (process_if_trns_proc, process_if_trns_free,
-                          process_if_expr);
-      process_if_expr = NULL;
-    }
-}
 
-/* PROCESS IF transformation. */
-static int
-process_if_trns_proc (void *expression_,
-                      struct ccase *c UNUSED, int case_nr UNUSED) 
-  
-{
-  struct expression *expression = expression_;
-  return (expr_evaluate_num (expression, c, case_nr) == 1.0
-          ? TRNS_CONTINUE : TRNS_DROP_CASE);
-}
-
-/* Frees a PROCESS IF transformation. */
-static bool
-process_if_trns_free (void *expression_) 
-{
-  struct expression *expression = expression_;
-  expr_free (expression);
-  return true;
-}
Index: pspp/src/data/variable.h
diff -u pspp/src/data/variable.h:1.8 pspp/src/data/variable.h:1.9
--- pspp/src/data/variable.h:1.8        Thu May  4 06:19:02 2006
+++ pspp/src/data/variable.h    Sat May  6 20:27:23 2006
@@ -126,9 +126,6 @@
     int cnt;                   /* Number of variables. */
   };
 
-/* PROCESS IF expression. */
-extern struct expression *process_if_expr;
-
 struct ccase;
 void dump_split_vars (const struct ccase *);
 
Index: pspp/src/language/ChangeLog
diff -u pspp/src/language/ChangeLog:1.6 pspp/src/language/ChangeLog:1.7
--- pspp/src/language/ChangeLog:1.6     Tue May  2 01:29:06 2006
+++ pspp/src/language/ChangeLog Sat May  6 20:27:23 2006
@@ -1,3 +1,11 @@
+Sat May  6 13:25:25 2006  Ben Pfaff  <address@hidden>
+
+       Continue reforming procedure execution.  In this phase, remove
+       PROCESS IF, which was deprecated anyway and can be easily
+       simulated with TEMPORARY followed by SELECT IF.
+
+       * command.def: Removed PROCESS IF.
+
 Mon May  1 18:17:52 2006  Ben Pfaff  <address@hidden>
 
        Further clean up the CMD_* command result codes.
Index: pspp/src/language/command.def
diff -u pspp/src/language/command.def:1.4 pspp/src/language/command.def:1.5
--- pspp/src/language/command.def:1.4   Mon May  1 22:59:22 2006
+++ pspp/src/language/command.def       Sat May  6 20:27:23 2006
@@ -109,7 +109,6 @@
 DEF_CMD (S_DATA, 0, "MODIFY VARS", cmd_modify_vars)
 DEF_CMD (S_DATA, 0, "ONEWAY", cmd_oneway)
 DEF_CMD (S_DATA, 0, "PEARSON CORRELATIONS", cmd_correlations)
-DEF_CMD (S_DATA, 0, "PROCESS IF", cmd_process_if)
 DEF_CMD (S_DATA, 0, "REGRESSION", cmd_regression)
 DEF_CMD (S_DATA, 0, "RENAME VARIABLES", cmd_rename_variables)
 DEF_CMD (S_DATA, 0, "SAMPLE", cmd_sample)
Index: pspp/src/language/expressions/helpers.h
diff -u pspp/src/language/expressions/helpers.h:1.4 
pspp/src/language/expressions/helpers.h:1.5
--- pspp/src/language/expressions/helpers.h:1.4 Fri May  5 04:53:13 2006
+++ pspp/src/language/expressions/helpers.h     Sat May  6 20:27:23 2006
@@ -19,6 +19,7 @@
 #include <data/value.h>
 #include <data/variable.h>
 #include <gsl-extras/gsl-extras.h>
+#include <language/expressions/public.h>
 #include <libpspp/compiler.h>
 #include <libpspp/message.h>
 #include <libpspp/misc.h>
Index: pspp/src/language/xforms/ChangeLog
diff -u pspp/src/language/xforms/ChangeLog:1.2 
pspp/src/language/xforms/ChangeLog:1.3
--- pspp/src/language/xforms/ChangeLog:1.2      Tue Apr 25 20:24:11 2006
+++ pspp/src/language/xforms/ChangeLog  Sat May  6 20:27:23 2006
@@ -1,3 +1,13 @@
+Sat May  6 13:25:57 2006  Ben Pfaff  <address@hidden>
+
+       Continue reforming procedure execution.  In this phase, remove
+       PROCESS IF, which was deprecated anyway and can be easily
+       simulated with TEMPORARY followed by SELECT IF.
+
+       * select-if.c (cmd_process_if): Removed.
+       (global var process_if_expr) Removed, along with all references
+       globally.
+
 Tue Apr 25 13:23:25 2006  Ben Pfaff  <address@hidden>
 
        * select-if.c (cmd_process_if): Use SW instead of MW for warning
Index: pspp/src/language/xforms/select-if.c
diff -u pspp/src/language/xforms/select-if.c:1.5 
pspp/src/language/xforms/select-if.c:1.6
--- pspp/src/language/xforms/select-if.c:1.5    Fri May  5 04:53:13 2006
+++ pspp/src/language/xforms/select-if.c        Sat May  6 20:27:23 2006
@@ -121,33 +121,3 @@
 
   return CMD_SUCCESS;
 }
-
-/* Expression on PROCESS IF. */
-struct expression *process_if_expr;
-
-/* Parses the PROCESS IF command. */
-int
-cmd_process_if (void)
-{
-  struct expression *e;
-
-  e = expr_parse (default_dict, EXPR_BOOLEAN);
-  if (!e)
-    return CMD_FAILURE;
-
-  if (token != '.')
-    {
-      expr_free (e);
-      lex_error (_("expecting end of command"));
-      return CMD_FAILURE;
-    }
-
-  if (process_if_expr)
-    {
-      msg (SW, _("Only last instance of this command is in effect."));
-      expr_free (process_if_expr);
-    }
-  process_if_expr = e;
-
-  return CMD_SUCCESS;
-}
Index: pspp/src/math/sort.c
diff -u pspp/src/math/sort.c:1.8 pspp/src/math/sort.c:1.9
--- pspp/src/math/sort.c:1.8    Fri May  5 04:53:13 2006
+++ pspp/src/math/sort.c        Sat May  6 20:27:23 2006
@@ -62,8 +62,6 @@
 prepare_to_sort_active_file (void) 
 {
   proc_cancel_temporary_transformations (); 
-  expr_free (process_if_expr);
-  process_if_expr = NULL;
 }
 
 /* Sorts the active file in-place according to CRITERIA.




reply via email to

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