Skip to content

Instantly share code, notes, and snippets.

@crazymonkyyy
Created October 21, 2023 16:36
Show Gist options
  • Save crazymonkyyy/2e072561568b894404d01cb6b396a7fa to your computer and use it in GitHub Desktop.
Save crazymonkyyy/2e072561568b894404d01cb6b396a7fa to your computer and use it in GitHub Desktop.

Interpolation strings

Field Value
DIP: (number/id -- assigned by DIP Manager)
Review Count: 0 (edited by DIP Manager)
Author: monkyyy, [email protected]
Implementation: (links to implementation PR if any)
Status: Draft

Abstract

The string debate heated up again

Contents

Rationale

Working with string sux, foo.to!string ~" "~bar.to!string

Prior Work

dip1027, yaidip, bash, etc.

Description

Im not a compiler dev to write the formal specs

$"$foo -$bar" becomes stringiterp("$foo -$bar",foo,bar)

A defualt string stringiterp(T...)(string s,T args) is added to std.string.

Overloading can be done by not importing std.string and defining a local stringiterp function

Breaking Changes and Deprecations

I know of nothing

Reference

Optional links to reference material such as existing discussions, research papers or any other supplementary materials.

Copyright & License

Copyright (c) 2022 by the D Language Foundation

Licensed under Creative Commons Zero 1.0

Reviews

The DIP Manager will supplement this section with a summary of each review stage of the DIP process beyond the Draft Review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment