Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ligature Request: ${ #343

Open
ElectricCoffee opened this issue Dec 28, 2016 · 3 comments
Open

Ligature Request: ${ #343

ElectricCoffee opened this issue Dec 28, 2016 · 3 comments

Comments

@ElectricCoffee
Copy link

It's used in both JavaScript

// JavaScript Template Strings
let p = new Person("George", 41);
console.log(`This is ${p.name}, he's ${p.age} years old.`);

And Scala

// Scala String Interpolation
val p = new Person("George", 41)
println(s"This is ${p.name}, the's ${p.age} years old.")

They serve the same purpose in both languages, and is functionally equivalent to Ruby's #{...} syntax.

@ciromattia
Copy link

In PHP too:

<?php
// variable interpolation
$a = 'variable';
echo "You can have a ${a} evaluated";
// variable evaluation
$b = 'anothervar';
${"my_prefix_" . $a} = "A";  // $my_prefix_variable == 'A';
${"my_prefix_" . $b} = "B";  // $my_prefix_anothervar == 'B';
?>

@ffxsam
Copy link

ffxsam commented Jul 4, 2017

I was just thinking this today, though I don't know what that ligature would look like.

@justrhysism
Copy link

I was thinking about this one and I think maybe if the ligature vertically aligned the characters. But it may be so subtle that it doesn't really add any value 🤷‍♂️

I like the idea though.

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

No branches or pull requests

5 participants
@ciromattia @justrhysism @ElectricCoffee @ffxsam and others