পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Tuesday, January 31, 2017

Erlang - Shell

The Erlang shell is used for testing of expressions. Hence, testing can be carried out in the shell very easily before it actually gets tested in the application itself.
The following example showcases how the addition expression can be used in the shell. What needs to be noted here is that the expression needs to end with the dot (.) delimiter.

Shell After the command is executed, the shell prints out another prompt, this time for Command Number 2 (because the command number increases each time a new command is entered).
The following functions are the most common one’s used in the Erlang shell.
  • b() − Prints the current variable bindings.
  • Syntax − b().
  • For example − Following is an example of how the function is used. First a variable called Str is defined, which has the value abcd. Then b() is used to display all the binded variables.
Erlang Shell b()
  • f() − Removes all current variable bindings.
  • Syntax − f().
  • For example − Following is an example of how the function is used. First a variable called Str is defined which has the value abcd. The f() is then used to remove the Str variable binding. The b() is then called to ensure the binding has been successfully removed.
Erlang Shell f()
  • f(x) − Removes the binding for a particular variable.
  • Syntax − f(x). Where, x – is the variable for which the binding needs to be removed.
  • For example − Following is an example of how the function is used. First a variable called Str and Str1 are defined. The f(Str) is then used to remove the Str variable binding. The b() is then called to ensure the binding has been successfully removed.
Erlang Shell f(x)
  • h() − Prints the history list of all the commands executed in the shell.
  • Syntax − h().
  • For example − An example of the h() command, which prints the history of commands executed in the shell is shown in the following screenshot.
Erlang Shell h()
  • history(N) − Sets the number of previous commands to keep in the history list to N. The previous number is returned. The default number is 20.
  • Syntax − history(N). Where, N – is the number to which the command history list needs to be limited to.
  • For example − An example of the history(N) command is shown in the following screenshot.
Erlang Shell history(N)
  • e(N) − Repeats the command N, if N is positive. If it is negative, the Nth previous command is repeated (i.e., e(-1) repeats the previous command).
  • Syntax − e(N). Where, N –is the command at the Nth position in the list.
  • For example − An example of the e(N) command is shown below. Since we have executed the e(-1) command, it will execute the previous command which was history(5).
Erlang Shell e(N)

No comments:

Post a Comment