[elixir-core:7873] Re: Proposal: Option to omit comments from generated mix projects

2018-02-14 Thread pragdave
✓👍 On Thursday, January 18, 2018 at 9:09:32 AM UTC-6, Ville Hellman wrote: > > Hey all, > > I'm proposing a new option for the `mix new` task: `--nocomments` when run > with this option it would omit all comments from the generated project > files. > > When first starting with Elixir I found the

[elixir-core:7874] Firing up an app in a slave node

2018-02-14 Thread pragdave
I’ve trying to create a kind of runner for a set of components, where each component runs on a separate node, and each component is an independent application. I’ve stolen code from the swarm cluster tests, and I’m successfully creating nodes which seem to contain the Elixir runtime. As I in

Re: [elixir-core:7878] Firing up an app in a slave node

2018-02-15 Thread pragdave
On Wednesday, February 14, 2018 at 4:25:36 PM UTC-6, José Valim wrote: > > We also do a similar setup in firenest test suite: > https://github.com/phoenixframework/firenest/blob/master/test/shared/test.ex > > I'm trying not to use a boot loader: the assumption is that the code for the spawned n

Re: [elixir-core:7879] Firing up an app in a slave node

2018-02-15 Thread pragdave
Oh, and just to clarify: I'm trying to do this in dev mode, so I want to run the application from its project directory. I may have to bit the bullet and just spawn a shell and run mix in it... :( -- You received this message because you are subscribed to the Google Groups "elixir-lang-core"

Re: [elixir-core:7881] Firing up an app in a slave node

2018-02-15 Thread pragdave
rocess, then indeed you might have > better luck just running Mix via `System.cmd` - there isn't necessarily > anything wrong with that approach, but then it's entirely up to you to > ensure that the spawned nodes are cleaned up before shutting down the > spawning node.

[elixir-core:7889] Add a `label:` option to IO.inspect

2018-02-19 Thread pragdave
When I use IO.inspect in a pipeline, I often find myself wanting to tag the output with some kind of label: ~~~ elixir get_name() |> IO.inspect() |> lookup_score() |> IO.inspect ~~~ so I sometimes write a trivial helper ~~~ def dump(value, label) do IO.puts "#{label}: #{inspect value}" valu

Re: [elixir-core:7891] Add a `label:` option to IO.inspect

2018-02-19 Thread pragdave
Damn. That was quick. (hides head in shame) On Monday, February 19, 2018 at 7:40:07 PM UTC-6, Paul Schoenfelder wrote: > > You can already do this today with IO.inspect(foo, label: "label") :) > > Paul > > On Mon, Feb 19, 2018 at 7:32 PM pragdave > > wrot

[elixir-core:8803] Suggestion for documenting defdelegate

2019-05-24 Thread pragdave
I quite often put the API for a library in the top-level module, but delegate all the calls down into various implementation modules. This leaves we with the problem of where to put the @doc. I want to put it in the API module so that clients of the library can see all the API documentation

Re: [elixir-core:8807] Suggestion for documenting defdelegate

2019-05-24 Thread pragdave
On Friday, May 24, 2019 at 4:18:39 PM UTC-5, Andrea Leopardi wrote: > > Forgot to say, I think the best route would be @doc see: > "String.length/1". Then it's the job of the doc tool to render it if they > want to. > But the _all_ doc tools would hav e to support it -- You received thi

Re: [elixir-core:8810] Suggestion for documenting defdelegate

2019-05-24 Thread pragdave
> > > Btw, “see” could be implemented as a library today, it just needs to be a > macro (a module attribute would be weird, especially since “@attr val” is > meant to set the attribute, and not execute custom code). So I would go > this route! > It definitely could, but then we'd need `use see

[elixir-core:11105] Partially applied pipelines/currying/etc

2022-10-25 Thread pragdave
I know this has been discussed before, in different forms, but I thought I’d just have another go following my recent earth-shattering PR :) I’d like to propose a new unary operator, &>. It works just like the pipeline |>, but doesn’t take a left argument. Instead it returns an arity 1 functi

Re: [elixir-core:11109] Partially applied pipelines/currying/etc

2022-10-26 Thread pragdave
On Tuesday, October 25, 2022 at 9:56:14 PM UTC-5 dorga...@gmail.com wrote: > For the plugs example, how is it better than the alternative that exists > today? > Because it is written without the magic. The way Plug currently works is needlessly nonfunctional and opaque. With this small chang

[elixir-core:6945] Is this a bug in my brain or the compiler?

2017-02-22 Thread pragdave
iex(16)> defmodule A do def _fib(n, %{ ^n => result }), do: result end** (MatchError) no match of right hand side value: :error Notice this is a compilation error. Some background. This is part of a Fibonacci function that uses a cache (the second parameter). If I get a cache hit, I want to r

Re: [elixir-core:6959] Is this a bug in my brain or the compiler?

2017-02-23 Thread pragdave
On Thursday, February 23, 2017 at 2:05:59 AM UTC-6, José Valim wrote: > > It is definitely a compiler bug, as that error message is not clear what > is happening. > > I will fix it on master. Thank you. > Does that mean I won't be able to write this? -- You received this message because you

[elixir-core:7394] Is there a way to do a global `use` during compilation in mix.exs?

2017-08-27 Thread pragdave
Let’s say I wanted to write a macro called defwombat that could be used just like defmodule but that compiled marsupials. And let’s pretend you thought it was a great idea. What I’d like to be able to do is to write: *dave.ex:* defwombat Eric do # ... marsupial stuffend That is, I’d like