Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Passing format keyword arguments #14

Open
hayd opened this issue Sep 26, 2015 · 1 comment
Open

Passing format keyword arguments #14

hayd opened this issue Sep 26, 2015 · 1 comment

Comments

@hayd
Copy link

hayd commented Sep 26, 2015

In python you can do the following:

 >>> "{a}".format(a=1)
'1'

it would be nice to do the same with Formatting.

@ScottPJones
Copy link
Collaborator

It's just string interpolation, but restricted to .format. For formatting, it would be good not to use things that are likely to conflict with common characters (like $ or even a bare {).
Swift's method of marking interpolation comes to mind, i.e. \(expr).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants