Project

General

Profile

Design #1292

Interpreter: fns which accept INT or RAT

Added by John Abbott about 5 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Parser/Interpreter
Target version:
Start date:
30 May 2019
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

There are quite a few functions which accept as arg INT or RAT.

The current solution is to call evalArgAsT1orT2<INT,RAT>;
in fact there are also several which call evalArgAsT1orT2orT3<INT,RAT,RINGELEM>.

I want to write a function which accepts a list of RAT but which continues to
work if some or all of the list entries are INT. The obvious call evalArgAsListOf<RAT>
does not do what I want -- it complains if there is an INT instead of a RAT.

It seems to me that INT should always be allowed where RAT is expected.
It is less clear to me whether a RAT with denominator 1 should be accepted where an INT is expected.

Ideas? Suggestions? Points to dicuss?

History

#1 Updated by John Abbott over 4 years ago

  • Target version changed from CoCoA-5.3.0 to CoCoA-5.4.0
Some cases where it may not be so clear:
  • den and num
  • SmoothFactor
  • floor and ceil

(probably several more)

#2 Updated by John Abbott over 2 years ago

  • Target version changed from CoCoA-5.4.0 to CoCoA-5.4.2

Also available in: Atom PDF