The Artima Developer Community
Sponsored Link

Programming in Scala Forum
What is the name of "=>" keyword?

11 replies on 1 page. Most recent reply: Mar 15, 2019 5:40 AM by Chris Anselmo

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 11 replies on 1 page
Vladimir Kelman

Posts: 46
Nickname: vkelman
Registered: Feb, 2008

What is the name of "=>" keyword? Posted: Sep 24, 2008 10:04 AM
Reply to this message Reply
Advertisement
Function literals are defined in Scala like
(x: Int) => x + 1 (page 178).
It's pretty much the same as lambda-functions are defined in C#. F# uses "->" instead.
Is there an official name for "=>" keyword? Is it something like "lambda operator" or simply "lambda"? Surprisingly, I didn't find its name, neither in C# books not in "Programming in Scala".


Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: What is the name of "=>" keyword? Posted: Sep 25, 2008 4:05 AM
Reply to this message Reply
I asked Martin Odersky a while back what he called this, and he said "right arrow". Ron Hitchens suggested the name "bullet" to me a couple months ago. I used that here and there, but it didn't seem to stick. About 2 weeks ago I asked some Ruby guys what they call it, and they said "hash rocket". The reason for "hash" is Ruby uses it for mapping keys to value, i.e., "key => value" in Ruby is like "key -> value" in Scala (but untyped in Ruby), and of course -> in Scala is a library abstraction, not part of the language.

So I suggest we call it "rocket". It's more exciting and less violent than bullet, and we can put an adjective in there to differentiate the various uses in Scala: there's "function rocket" in anonymous functions, maybe a "case rocket" in a case clause in match expression or partial function, etc.

Seth Tisue

Posts: 2
Nickname: sethtisue
Registered: Feb, 2008

Re: What is the name of "=>" keyword? Posted: Sep 25, 2008 12:48 PM
Reply to this message Reply
I like it.

Vladimir Kelman

Posts: 46
Nickname: vkelman
Registered: Feb, 2008

Re: What is the name of "=>" keyword? Posted: Sep 25, 2008 6:55 PM
Reply to this message Reply
Bill, I have a bad habit of asking the same question on Nabble forum, because there are a lot of people and they answer fast. This time Tony Morris answered immediately, but I had a bit hard time understanding his answer... sometimes he is too knowledgeable for regular people like myself :(

Jeff Heon

Posts: 40
Nickname: jfheon
Registered: Feb, 2005

Re: What is the name of "=>" keyword? Posted: Sep 25, 2008 7:54 PM
Reply to this message Reply
To put it simply, he calls the "=>" keyword "implies".

Vladimir Kelman

Posts: 46
Nickname: vkelman
Registered: Feb, 2008

Re: What is the name of "=>" keyword? Posted: Sep 25, 2008 8:32 PM
Reply to this message Reply
I didn't provide a correct link (http://www.nabble.com/What-is-the-name-of-"%3D>"-keyword--td19656616.html), sorry - no way to do it. "Implies" sounds strange to me (with my bad English). Tony then suggested "gives rise to"... I still wonder why there is no well-known common term used across functional languages.

Dirk Detering

Posts: 16
Nickname: det
Registered: Jul, 2005

Re: What is the name of "=>" keyword? Posted: Sep 26, 2008 12:44 AM
Reply to this message Reply
Well, I think "implies" reflects the mathematical/logical meaning of it and so should be used in texts trying to be formally correct.

But I like the "rocket" for developer talk too, it's communicative, like the "shebang" in Unix Shell or the "elvis operator" in Groovy.

"Right arrow" - well I would relate that more to the -> sign.

Vladimir Kelman

Posts: 46
Nickname: vkelman
Registered: Feb, 2008

Re: What is the name of "=>" keyword? Posted: Sep 28, 2008 9:09 AM
Reply to this message Reply
At this moment, I would prefer either "maps to" (as was recently suggested in that thread in nabble.com) or "implies"
Is there a dictionary of mathematical terms somewhere online?

Jeff Heon

Posts: 40
Nickname: jfheon
Registered: Feb, 2005

Re: What is the name of "=>" keyword? Posted: Sep 28, 2008 1:15 PM
Reply to this message Reply
> Is there a dictionary of mathematical terms somewhere
> online?

Here's one, positioned at the implies page:
http://mathworld.wolfram.com/Implies.html

Jonathan Finn

Posts: 10
Nickname: lucretius
Registered: Jun, 2006

Re: What is the name of "=>" keyword? Posted: Oct 5, 2008 5:38 PM
Reply to this message Reply
The name "bullet" is a no-go surely: it's the standard name of a quite different symbol, the little black circle that starts a bullet point.

Douglas Viltrakis

Posts: 10
Nickname: douglasv
Registered: Aug, 2010

Re: What is the name of "=>" keyword? Posted: Aug 23, 2010 8:18 AM
Reply to this message Reply
doesn't this signify the end of parameters list
in a function context? and the beginning of the result op

twixt and tween , call it weenie

Chris Anselmo

Posts: 1
Nickname: chsrians
Registered: Mar, 2019

Re: What is the name of "=>" keyword? Posted: Mar 15, 2019 5:40 AM
Reply to this message Reply
Hi! For many students, writing academic papers can be a daunting challenge, especially when it comes to writing a poem. But now you shouldn't squeeze rhymes and force yourself to do it. With the help of this writing service https://dissertationmasters.com/poem-writing-service.html you'll prove your professor you're a bright student.

Flat View: This topic has 11 replies on 1 page
Topic: Doubt in Scala Program Previous Topic   Next Topic Topic: Paper book to pdf version

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use