treat globals as constant within top-level expressions when possible · Issue #524 · JuliaLang/julia (original) (raw)

@pao

Description

@pao

   _       _ _(_)_     |
  (_)     | (_) (_)    |  A fresh approach to technical computing
   _ _   _| |_  __ _   |
  | | | | | | |/ _` |  |  Version 0.0.0-prerelease
  | | |_| | | | (_| |  |  Commit 335d1ef401 (2012-03-04 23:47:29)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |

julia> x = 5
5

julia> typeof(x)
Int64

julia> typeof([i | i = 1:5])
Array{Int64,1}

So far, so good.

julia> typeof([i | i = 1:x])
Array{Any,1}

Wat.
(with apologies to https://www.destroyallsoftware.com/talks/wat)

Metadata

Metadata

Development

No branches or pull requests

Issue actions