Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 132407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:15:28+00:00 2026-05-11T06:15:28+00:00

I saw this code in Erlang: [X-$0 || X<-someFun()] In that line I found

  • 0

I saw this code in Erlang:

[X-$0 || X<-someFun()] 

In that line I found the -$0 syntax very useful.

I read the code and estimated what it means, but I’m not quite sure: is it split all numbers?

I’d like to see the explanation or man page of that syntax but I can’t find it. Can anyone show me the right page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:15:28+00:00Added an answer on May 11, 2026 at 6:15 am

    What that code is doing is taking the output from someFun() (which needs to return a list), and for each element in the list it is assigning the element’s value to the variable X and then subtracting the ASCII value of the character 0 from that value. The resulting list is then the value of that whole expression.

    What it’s doing, in practice (and I’ve written this code dozens of times myself), is assuming that someFun/0 is a function that returns a string with just digits in it, and then converting that string into a list of the digits. So, if someFun() returned ‘12345‘, the result of this list comprehension is [1, 2, 3, 4, 5].

    If you’re familiar with the concept of a map function (as in, MapReduce), then this should be sounding pretty familiar by now.

    This wikibooks page looks like a good introduction to Erlang list comprehensions:

    http://en.wikibooks.org/wiki/Erlang_Programming/List_Comprehensions

    Joe Armstrong’s book ‘Programming Erlang’, from the Pragmatic Bookshelf, (http://pragprog.com/titles/jaerlang/programming-erlang) also covers list comprehensions really well (along with everything else Erlang related). Excellent book, highly recommended, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saw this code in http://www.cise.ufl.edu/~manuel/obfuscate/obfuscate.html (http://www.cise.ufl.edu/~manuel/obfuscate/savastio) website.But this code is very very crazy.
I saw this code on someone else's website, but found no reference to it
I saw this code snippet const volatile int * volatile * const X; but
I saw this in some code: $(<p/>).append(<div>something</div>).appendTo(body); and noticed that it automatically closed the
I saw this C# using statement in a code example: using StringFormat=System.Drawing.StringFormat; What's that
I saw this code but I couldn't understand what it does: inline S* O::operator->()
I saw this code line in the Direct3D SDK and I want to know
hello i saw this code that make a scale animation for a list view
I just started working in a .Net company and I saw this code but
I saw this code before, but I don't know what the meaning: var person1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.