Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A alexandria
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 9
    • Issues 9
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • alexandria
  • alexandria
  • Issues
  • #25

Closed
Open
Created Oct 24, 2021 by Tim Bradshaw@tfebDeveloper

string element types should perhaps be smarter

20211024

Issue text

string element types should perhaps be smarter

This is closely related to #24 (closed), but unlike that issue my suggested solution is, potentially, not completely compatible although I rather doubt anything will care.

(1.) read-file-into-string opens the file with an external format specified by an argument to the function, but doesn't specify the element type. That means that in conforming implementations you'll always get character, and on implementations like LW which have a make-thinner-strings-by-default option you may get an error if you specify an external format which will produce characters (this is a deficiency in LW I think although it's the documented behaviour: I've suggested that open could 'fatten' the stream in the case where the external format clearly implies character types larger than the default one).

I think a solution to (1) is to specify the element type as :default which will explicitly produce an element type big enough for the external format. this keeps LW happy but also will mean that other implementations which may be able to produce thinner strings may actually be able to do that. On the other hand the element types of those strings will now not be character so this is potentially a slightly incompatible change.

(2) write-string-into-file also does not specify the element type of the stream. This can, again, break on LW for the same reasons as (1). I think it safe to specify it as :default which means it will always correspond to whatever the external format implies.

I believe that (2) is a fully compatible change.

Assignee
Assign to
Time tracking