Project

General

Profile

Bug #117

Added 3 times defn of isblank fn

Added by John Abbott almost 12 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Portability
Target version:
Start date:
03 Apr 2012
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:

Description

To enable compilation on MSVC, I had to add defn of isblank.
Currently there are 3 separate (but identical) defns in the following files:
  • AST.C
  • C5.C
  • Lexer.C

It would be better to have a single defn somewhere; or perhaps import it from BOOST (if they offer one).

History

#1 Updated by John Abbott almost 12 years ago

As far as I can tell BOOST does not offer such a simple fn.

#2 Updated by Anna Maria Bigatti almost 12 years ago

  • Category set to Portability

#3 Updated by John Abbott almost 12 years ago

Maybe put IsBlank into a file called C5utils?
What do you think? Perhaps a few other fns could be moved there too?

#4 Updated by Anna Maria Bigatti almost 12 years ago

John Abbott wrote:

Maybe put IsBlank into a file called C5utils?
What do you think? Perhaps a few other fns could be moved there too?

I think it could be a good idea.
It could be a good place for functions which might be sooner or later imported from BOOST or C++11

#5 Updated by Anna Maria Bigatti almost 10 years ago

  • Target version set to CoCoA-5.1.0 Easter14

#6 Updated by John Abbott almost 10 years ago

  • Target version changed from CoCoA-5.1.0 Easter14 to CoCoA-5.1.1 Seoul14

#7 Updated by John Abbott over 9 years ago

  • Target version changed from CoCoA-5.1.1 Seoul14 to CoCoA-5.1.2 summer 2015
  • Estimated time changed from 1.00 h to 2.00 h

#8 Updated by John Abbott over 8 years ago

There is a C++ function called isspace which returns true for space, TAB, and 4 others: '\n' (newline), '\v' (vertical tab), '\f' (form feed), '\r' (carriage return).

The fn comes from C, and appears to be in header <cctype>.

Can we replace IsBlank by this standard function? Our defn of IsBlank simply checks for space or TAB.

#9 Updated by John Abbott over 8 years ago

  • Priority changed from Normal to High
  • Target version changed from CoCoA-5.1.2 summer 2015 to CoCoA-5.1.3/4 Jan 2016

Postponing to next version. Increased priority (so I might actually do something).

#10 Updated by John Abbott over 8 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 20

I have put the fn into a new file C5Utils.H; so far there is no C5Utils.C file.
Everything compiles, and tests pass.

Is it worth creating a new file to avoid repeated defn of such a short and simple fn?

Note: I changed the name of the fn to IsBlank

#11 Updated by John Abbott over 8 years ago

  • Assignee set to John Abbott

I recall that GMP often has a file containing just a single function, and indeed for speed of recompilation it is better to have many small files.

It is certainly not a good idea to have several functions with the same name and same definition.

So overall I think it is worth creating an extra file.

#12 Updated by John Abbott over 8 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 20 to 90

I've checked in: 1 new file, 3 modified files. All should be OK.

#13 Updated by John Abbott about 8 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100

Apparently this has been working fine for 4 months or more, so closing.

Also available in: Atom PDF