Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate using && and || within at-dot expressions #26792

Merged
merged 2 commits into from
Apr 20, 2018
Merged

Conversation

mbauman
Copy link
Member

@mbauman mbauman commented Apr 12, 2018

Giving us space to allow lowering this to .&& and .|| in the future. Ref #5187.

Giving us space to allow lowering this to `.&&` and `.||` in the future. Ref #5187.
@mbauman mbauman requested a review from stevengj April 12, 2018 19:42
@mbauman mbauman added broadcast deprecation This change introduces or involves a deprecation labels Apr 12, 2018
if x.head == :&& || x.head == :||
Base.depwarn("""
using $(x.head) expressions in @. is deprecated; in the future it will
become elementwise. Break the expression into smaller parts instead.""", ())
Copy link
Member

@JeffBezanson JeffBezanson Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should still pass some name symbol, maybe :__dot__. Or nothing if absolutely necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I tried that. The trouble is then the stackframe is identical to every call, leading to only one depwarn. This is a hack that when you pass (), it'll skip the stack frame lookups and just always warn.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose I could change the hack to look at the symbol and always warn if it starts with @. That's probably better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok then we should use nothing instead of ().

@StefanKarpinski
Copy link
Member

We do really need to support .&& and .|| but that's a feature so we can add it in 1.x.

@JeffBezanson JeffBezanson added the triage This should be discussed on a triage call label Apr 19, 2018
@JeffBezanson JeffBezanson added this to the 1.0 milestone Apr 19, 2018
@JeffBezanson JeffBezanson removed the triage This should be discussed on a triage call label Apr 19, 2018
@JeffBezanson JeffBezanson merged commit 23b08c5 into master Apr 20, 2018
@JeffBezanson JeffBezanson deleted the mb/dotjohnny5 branch April 20, 2018 18:44
mbauman added a commit that referenced this pull request Apr 23, 2018
* origin/master: (23 commits)
  fix deprecations of \cdot and \times (#26884)
  Support reshaping custom 0-dimensional arrays (#26870)
  fix some cases of dot syntax lowering (#26878)
  Pkg3: deterministically close the LibGit2 repo in tests (#26883)
  code loading docs: add missing graph edge (#26874)
  add news for #26858 and #26859 [ci skip] (#26869)
  Deprecate using && and || within at-dot expressions (#26792)
  widen `Int8` and `Int16` to `Int` instead of `Int32` (#26859)
  fix #26038, make `isequal` consistent with `hash` for `Ptr` (#26858)
  Deprecate variadic size(A, dim1, dim2, dims...) method (#26862)
  add using Random to example in manual (#26864)
  warn once instead of depwarn since we want to test it
  Revert "reserve syntax that could be used for computed field types (#18466) (#26816)" (#26857)
  Fix compilation on LLVM 6.0
  change promotion behaviour of `cumsum` and `cumsum!` to match `sum`
  [LLVM 6] add patch to diamond if-conversion
  add a precompile command that can be used to precompile all dependencies (#254)
  use registry if no version entry exist in project for developed pacakges
  make Pkg3 work as a drop in for the old CI scripts
  update registries when adding (#253)
  ...
@mbauman mbauman added the broadcast Applying a function over a collection label Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broadcast Applying a function over a collection deprecation This change introduces or involves a deprecation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants