Viktor Söderqvist
Viktor Söderqvist
Great that we agree! :relieved: Perhaps the assumption that specs can't overlap makes it easier for us. This is from https://www.erlang.org/doc/reference_manual/typespec.html#specifications-for-functions: > A function specification can be overloaded. That is,...
Right, it looks much more reasonable to have `any()` in a catch-all clause. If we'd have negation and intersection, we could interpret `_` in the second clause as `any() \...
So what's the idea? To return the absform of the function call `self()` or something else?
I think there is no abstract form for ``.
We use erl_pp:expr/1 to format it back to Erlang, so this doesn't work: ```Erlang 1> lists:flatten(erl_pp:expr({pid, erl_anno:new(0), ''})). "INVALID-FORM:{pid,0,''}:" ``` Using `self()` would work though: ```Erlang 2> lists:flatten(erl_pp:expr({call, 0, {atom,...
Sure, that works. Nether pid(0,0,0) nor self() are values, but expressions that evaluate to values in a very strait-forward way, so the error message would be very easy to understand...
`pid(_,_,_)` is a pattern. It's not a valid expression. Therefore, I think it's weird. I prefer self(). But, @erszcz you're right, the same example with `Q = self()` would be...
> The quickest and most clean in either cases seems like `lists:flatten(erl_pp:expr({value, erl_anno:new(0), self() })).` Could this be okay? Instead of `call` just put `value` and `self()` or `` @VincentVanBork...
"%% Special case for straight values." :-) Undocumented but OK, I think we can use it.
Actually I like even more. It is a value which is printed and it doesn't matter that you can't write it as a literal.