Questions tagged [elixir-iex]

Elixir’s interactive shell.

iex is Elixir’s interactive shell, which can be used to interactively run Elixir code from the command line.

150 questions
2
votes
1 answer

Is There A Built In IEX Command To Invoke Formatting?

I checked h and h(IEx) and didn't come up with anything. I am sure I can shell out to a command prompt and run "mix format" but I was wondering if I'm missing something. Is there any command analogous to recompile/0 or r/1 for iex to allow me to…
Onorio Catenacci
  • 14,928
  • 14
  • 81
  • 132
2
votes
1 answer

Elixir phoenix debugging leads to interactive shell instead of pry

I've been trying to debug a phoenix application. To do so I used the following instructions: - To set a break point: require IEx; IEx.pry - To start a debugging server: iex -S mix phx.server The problem comes when starting the server, the above…
2
votes
4 answers

Using IEX API for real-time stock info (Yahoo Finance replacement)?

Just like the title says, I'm looking for a replacement source for stock info now that Yahoo has disabled the API many people have been using. The new source I've been looking at is found here: https://iextrading.com/developer/ My question is how to…
Joe
  • 43
  • 1
  • 5
2
votes
0 answers

How can i set a callback to run before an IEx session closes?

I want to setup some cleanup code to run before a user terminates a REPL session started with iex -S mix. I was expecting that running: System.at_exit fn (_) -> File.write! "afile", "it works" end inside an iex session to create a file named afile…
Dimitris Zorbas
  • 5,187
  • 3
  • 27
  • 33
2
votes
0 answers

Iex on alchemist, cannot type capital "T"

Just started using spacemacs with Alchemist. I am currently working on an Elixir file with the Filename of times.exs (from Programming Elixir book). The module is named Times. As I use the Iex on Alchemist, I found out that I cannot type the capital…
2
votes
1 answer

Why is the pid for my iex sessions always the same?

In between restarts of iex process, on my machine, why is its pid always the same? iex> self #PID<0.81.0> iex> ^C BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution Again iex>…
Waseem
  • 8,232
  • 9
  • 43
  • 54
2
votes
0 answers

In IEx why \t becomes spaces but not tab?

In IEx, puts \t prints up to 7 spaces. iex(1)> IO.puts "1\t2" 1 2 # same as 1\s\s\s\s\s\s\s2 However if I put the same code in a file, and run it in bash, it gives me the real tab $ elixir test.exs 1 2 # same as 1\t2 You can use…
sbs
  • 4,102
  • 5
  • 40
  • 54
2
votes
1 answer

Windows - Elixir 'mix' is undefined within iex intepreter

I want to build an application using 'mix' command. mix new appname --module MODULE But on the iex interpreter it isn't recognized I read online another alternative to running what I want is to pass it as a script argument: $ bin/elixir bin/mix…
Jebathon
  • 4,310
  • 14
  • 57
  • 108
2
votes
1 answer

Is there a Switch to enable thousand digit grouping (100_000) by default in Iex

Please is there a switch to enable thousand digit grouping (e.g 100_000) by default in Iex. It would be really helpful if is. Otherwise how can we specify it in IO.puts?
Charles Okwuagwu
  • 10,538
  • 16
  • 87
  • 157
1
vote
1 answer

Elixir install dependencies command `mix deps.get` is throwing error

Getting error when installing Elixir dependencies, all Mix command are throwing same exception 23:31:44.447 [notice] Application ssl exited: exited in: :ssl_app.start(:normal, []) ** (EXIT) an exception was raised: ** (ArgumentError)…
1
vote
0 answers

Map.keys method in elixir is returning \n for a particular case while computing mode

Iam trying to compute the mode for a list in elixir but for one particular case when iam filtering out the keys from the resulting ranked_map, iam getting \n as output. Here is my code defmodule Stats.CentralTendency.Mode do def mode(nums)…
1
vote
1 answer

Elixir list is ending in periods

I am trying to return a list in Elixir that has a length of 52 but the list always ends up being returned with the last two elements being turned to periods. I tested it in the iex in command prompt using: list =…
1
vote
2 answers

Automatically print info including stacktrace for uncaught errors in Elixir

I am currently learning Elixir and setting up a toy REST service example using Plug. Here is the code that I wrote initially. It has a bug on the row that generates a random number. I was able to figure out the issue. However, when the error occurs…
oneself
  • 38,641
  • 34
  • 96
  • 120
1
vote
4 answers

What is the javascript array.map equivalent in Elixir?

I am new to elixir I know how to solve the issue in JavaScript, but i am having a hard time converting it to elixir solution. I am trying to take a list in and output the words the occur more than once const str = "This is the state of education? is…
1
vote
0 answers

Invoke Expression while using iex in Elixir

I am just beginning with elixir. I created a project using "mix" and wrote the below code. defmodule HelloWorld do def hello_world do IO.puts("Hello World!") end end #calling the function hello_world HelloWorld.hello_world() After that I…
Surbhi Rathi
  • 9
  • 1
  • 2