Top "Syntactic-sugar" questions

Syntactic sugar is a computer science term that refers to syntax within a programming language that is designed to make things easier to read or to express.

Haskell record syntax

Haskell's record syntax is considered by many to be a wart on an otherwise elegant language, on account of its …

layout haskell syntax syntactic-sugar
Syntax sugar: _* for treating Seq as method parameters

I just noticed this construct somewhere on web: val list = List(someCollection: _*) What does _* mean? Is this a syntax sugar …

scala syntactic-sugar
java, is there a way we can import a class under another name

is there a way we can import a class under another name? Like if i have a class called javax.…

java syntactic-sugar import
Elegant ways to return multiple values from a function

It seems like in most mainstream programming languages, returning multiple values from a function is an extremely awkward thing. The …

python function language-agnostic language-design syntactic-sugar
Do nothing when "other side" of ternary operator is reached?

Note: I've seen this question asked sometimes before (a, b, c), but neither of these was in C#, nor helpful. …

c# syntactic-sugar
What does extended slice syntax actually do for negative steps?

The extended slice syntax in python has been explained to me as "a[n:m:k] returns every kth element …

python list slice syntactic-sugar
What are all the instances of syntactic sugar in Scala?

What are all the instances of syntactic sugar in Scala? They are hard to search for since most/all of …

scala syntactic-sugar
Best javascript syntactic sugar

Here are some gems: Literals: var obj = {}; // Object literal, equivalent to var obj = new Object(); var arr = []; // Array literal, equivalent …

javascript language-features syntactic-sugar
Syntactic sugar in C/C++

I have been looking into Ruby and find its keywords "until" and "unless" very interesting. So I thought what was …

c++ c syntax metaprogramming syntactic-sugar
Scala Map: mysterious syntactic sugar?

I have just found out this syntax for a scala Map (used here in mutable form) val m = scala.collection.…

scala maps syntactic-sugar scala-collections