Re: [elixir-core:9482] Re: Proposal: IO.error/2

2020-05-15 Thread José Valim
1. Yes, the granularity you get is per macro. 2. When emitting the warning, do "Macro.Env.stacktrace(__CALLER__)" to get the actual caller. You may also need to look at the AST to get the proper line. Note you would need to do the same if we were to introduce some sort of IO.error. On Fri, May

Re: [elixir-core:9482] Re: Proposal: IO.error/2

2020-05-15 Thread Dallin Osmun
Hi José, Thanks for the helpful response! What you are saying makes sense. I must admit I don't have a very advanced knowledge of metaprogramming in elixir so I'll have to learn/practice a lot more before I can come up with an informed response. I tried out your suggestion and wanted to

Re: [elixir-core:9484] Re: Proposal: IO.error/2

2020-05-15 Thread Dallin Osmun
I must be missing something. I am already using Macro.Env.stacktrace when emitting my warnings and that's working great. The problem happens when calling raise. Is there a way to pass a new stacktrace into raise? The docs for Kernel.raise say it accepts either a message or an exception and

Re: [elixir-core:9488] Proposal: Task.Supervisor.async_stream_nolink to monitor created tasks same as Task.Supervisor.async_nolink

2020-05-15 Thread José Valim
In async_stream there is a separate process that controls the stream, so there isn't much the parent process can do, even in terms of monitors. If you need monitors and control, then it is best to not use the stream. I will update the docs, thanks! On Fri, May 15, 2020 at 9:51 PM Anastasiya

Re: [elixir-core:9486] Re: Proposal: IO.error/2

2020-05-15 Thread cward
It seems unreasonable for the editor to infer the line number from the `message` key. Am I wrong in thinking that? It seems that `position` is getting lost at some point in translation. Why would the `message` string contain the full stacktrace with line number, but `position` is `nil`? After

Re: [elixir-core:9490] Re: Proposal: IO.error/2

2020-05-15 Thread Dallin Osmun
Hi José Thank you so much for taking the time to respond to this thread. It has been incredibly helpful and is very much appreciated! I think I may have found an issue with how line numbers are determined for exceptions raised in macros. I submitted a PR here:

Re: [elixir-core:9487] Re: Proposal: IO.error/2

2020-05-15 Thread José Valim
Given Elixir compile time is really executing code, then I think it would be a nice feature to attempt to extract it from exceptions, although I understand it can be brittle. If the error is really a compile-time reason (invalid syntax, invalid call, etc), then Elixir does show a proper error

Re: [elixir-core:9490] Re: Proposal: IO.error/2

2020-05-15 Thread José Valim
Awesome job on the PR! On Fri, May 15, 2020 at 23:09 Dallin Osmun wrote: > Hi José > > Thank you so much for taking the time to respond to this thread. It has > been incredibly helpful and is very much appreciated! > > I think I may have found an issue with how line numbers are determined for >

Re: [elixir-core:9484] Re: Proposal: IO.error/2

2020-05-15 Thread José Valim
You can use reraise/3. It is a bit misnamed, but it is correct. But this behaviour in particular sounds like a bug in the editor itself, given it does have a line in the stacktrace specific to that file. On Fri, May 15, 2020 at 8:04 PM Dallin Osmun wrote: > I must be missing something. I am

[elixir-core:9487] Proposal: Task.Supervisor.async_stream_nolink to monitor created tasks same as Task.Supervisor.async_nolink

2020-05-15 Thread Anastasiya Dyachenko
Hi! I propose to add monitoring of tasks, created in Task.Supervisor.async_stream_nolink, so it would work the same as Task.Supervisor.async_nolink for cases when it used in OTP behaviour. For now, there is no info in docs that there are no monitoring and handle_info would not call, cause docs

[elixir-core:9492] [Proposal] Support transforming lists to type specs

2020-05-15 Thread Kip
It's not uncommon to have domain overlap between lists of valid tokens (used for validations) and type specs. For example: @standard_formats [ :standard, :accounting, :currency, :percent ] @currency_formats [ :currency, :accounting, :currency_long,

[elixir-core:9493] Elixir 1.10-dev: adding transitive deps to mix.exs now a requirement?

2020-05-15 Thread Kip
I notice on elixir master than a warning is now issued if transitive dependencies aren't directly configured in `mix.exs` and I'm curious as to the motivation and purpose. -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe