🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: fj.mail-lists.reduce
1 messages
1 total messages Started by Dresse Alain Fri, 05 Mar 1993 11:29
Unexpected behavours in reduce
#67
Author: Dresse Alain
Date: Fri, 05 Mar 1993 11:29
75 lines
2165 bytes
Hello,

I have had two problems lately in reduce. They conscern
a. applying rules to operators with list arguments
   the rules don't apply in some simple cases.

b. the construct "for each .. in .. join .." in symbolic mode.
   It can be destructive.
   This could be considered normal (mapcan is destructive), but should
   probably be stated in the manual... particularly since the
   behaviour is different in algebraic mode.

The problems are illustrated in the session below.
-- 
Alain Dresse, Universite Libre de Bruxelles
Campus Plaine, CP 231, B-1050 Bruxelles, Belgium

email: adresse@ulb.ac.be


-------------------------------------------------------------
REDUCE 3.4, 15-Jul-91 ...

%
% problem 1 : rules with listargp operators
%

1: operator f;

2: listargp f;

3: f({1}) where {f(~x) => 1};

F({1})

%% I would have expected 1 !
%% note however that

4: f({1})^2 where {f(~x)^2 => 1};

1

%
% problem 2 : destructive joining in symbolic mode
%

%% behaviour in algebraic mode

5: a_list := {{1,2},{3,4}};

A_LIST := {{1,2},{3,4}}

6: for each elt in a_list join elt$

7: a_list;

{{1,2},{3,4}}

%% behaviour in symbolic mode

8: symbolic;

NIL

9: s_list := '((1 2) (3 4));

((1 2) (3 4))

10: for each elt in s_list join elt$

11: s_list;

((1 2 3 4) (3 4))
  %% I would have expected s_list not to change, based on the
  %% behaviour in algebraic mode...
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads