grangerelixx

grangerelixx

Function calling another function

I have a function Function_1(arg1,arg2,arg3)

I would like to call Function_1 in another function Function_2( ) where only arg3 is passed like arg3 \\ :hello

And I would like to use Function_2( ) in my code like this

result =
arg_1_val
|> Function_2(arg_2_val)

Here arg_1_val is my arg1, arg_2_val is my arg2 and arg3 will be passed in Function_2 definition.

Any inputs on what is the right approach to do this are appreciated.

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hi @grangerelixx, can you make this more concrete? You aren’t actually posting valid elixir code, which makes this hard to understand.

derek-zhou

derek-zhou

Of cause you can do that. However, I’d suggest you to finish some elixir tutorial on your own first, otherwise it is hard for other people to offer you help without knowing you have a baseline knowledge.

If you have prior experience with functional programming, the official Elixir tutorial should be enough. If you do not have any experience of functional programming, you can consider to purchase a book or some online tutorial that have more details than the official elixir tutorial.

eksperimental

eksperimental

I will replace “can” with “must”. Otherwise, if you call: function_with_arg3_equals_5(1, 2, 10000) it defeats the purpose of the funtion name, and you should be calling function_1/3

Where Next?

Popular in Questions Top

hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement