Post Reply 
functions with surprising behaviour/fonctions au comportement surprenant
07-21-2022, 11:01 AM
Post: #5
RE: functions with surprising behaviour/fonctions au comportement surprenant
Bonjour

Petit problème, DIM accepte des sous listes comme beaucoup d'autres fonctions d'ailleurs :
DIM({"abc",{"cd","eee"}) --> {3,{2,3}}

Voici donc une nouvelle version de CDIM :


Hello

Small problem, DIM accepts sublists like many other functions:
DIM({"abc",{"cd", "eee"}) --> {3,{2,3}}

So here is a new version of CDIM:
Code:
EXPORT CDIM(s)
BEGIN
 LOCAL f:=(TYPE(s)=6),i,r:={};
 IF f THEN
  FOR i FROM 1 TO SIZE(s) DO
   r(0):=CDIM(s(i));
  END; 
 ELSE
  RETURN IFTE(TYPE(s)==2,DIM(s),UPPER(1));
 END;
END;

Sorry for my english
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: functions with surprising behaviour/fonctions au comportement surprenant - Tyann - 07-21-2022 11:01 AM



User(s) browsing this thread: 1 Guest(s)