Project

General

Profile

Feature #1599

ConcatStr

Added by John Abbott almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
enhancing/improving
Target version:
Start date:
12 Jun 2021
Due date:
% Done:

100%

Estimated time:
1.11 h
Spent time:

Description

Do we want to have a function ConcatStr (and possibly a variant which puts a "separator" between the strings in the list)?

This was first suggested in issue #1587.

Discuss, decide, implement (if nec).


Related issues

Related to CoCoA-5 - Feature #1587: Multiline string literals (again)Closed2021-04-02

Related to CoCoA-5 - Feature #1431: Juxtaposition of string literalsRejected2020-03-03

History

#1 Updated by John Abbott almost 3 years ago

  • Related to Feature #1587: Multiline string literals (again) added

#2 Updated by John Abbott almost 3 years ago

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

I already have an impl (see #1587#note-6 and #1431#note-9).

I think it could be useful. The only doubt I have currently is whether it should simply be called by concat if the arg passed is a list of strings...

Advantage of a separate name is that it is clearer from the fn name what is being computed (also it would work with an empty list).
Disadvantage is that the user would have to learn another name (and with well-chosen var names the advantage above would be only minor).

It is not entirely clear to me how we could detect inside the impl for concat whether the arg is a list of strings without encountering problems of double-evaluation.

Opinions?

#3 Updated by John Abbott almost 3 years ago

  • Related to Feature #1431: Juxtaposition of string literals added

#4 Updated by John Abbott almost 3 years ago

  • Assignee set to John Abbott
  • % Done changed from 10 to 50

The fn maps a list of strings to a string by concatenation.
Should the fn be called ConcatStr or ConcatStrs?

#5 Updated by John Abbott almost 3 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 80

Renamed to ConcatStrings.
Very clear.

#6 Updated by John Abbott over 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 80 to 100
  • Estimated time set to 1.11 h

Also available in: Atom PDF