Skip to content

Commit

Permalink
streamline a[begin] lowering via firstindex(a, n) (JuliaLang#35779)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Dec 1, 2020
1 parent 8ea6365 commit 59d676c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Language changes
a function like other operators. The dotted version `.-->` is now parsed as well.
For backwards compatibility, `-->` still parses using its own expression head
instead of `:call`.
* The `a[begin]` syntax now calls `firstindex(a,1)` rather than `first(axes(a,1))` ([#35779]).
* `` (U+233F) and `¦` (U+00A6) are now infix operators with times-like and plus-like precedence,
respectively. Previously they were parsed as identifier characters ([#37973]).

Expand Down
2 changes: 1 addition & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
(if (null? tuples)
(if (and last (= n 1))
`(call (top firstindex) ,a)
`(call (top first) (call (top axes) ,a ,n)))
`(call (top firstindex) ,a ,n))
(let ((dimno `(call (top +) ,(- n (length tuples))
,.(map (lambda (t) `(call (top length) ,t))
tuples))))
Expand Down

0 comments on commit 59d676c

Please sign in to comment.