Skip to content

Commit

Permalink
Fix issue with time failing to expand with macroexpand-all (#1144)
Browse files Browse the repository at this point in the history
Hi,

could you please consider patch to use an auto-gensym for the let
binding in the `time` macro. It addresses #1143.

I assumed here that a straight let binding was used inadvertently rather
than an auto-gensym.

No tests were included due to the simplicity of the fix.

Thanks

Co-authored-by: ikappaki <[email protected]>
  • Loading branch information
ikappaki and ikappaki authored Nov 25, 2024
1 parent 8fcc065 commit 52f2c21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Fix a bug where `keyword` and `symbol` functions did not treat string arguments as potentially namespaced (#1131)
* Fix a bug where `condp` would throw an exception if a result expression was `nil` (#1137)
* Fix a bug where integer division which resulted in an integer would return a `fractions.Fraction` (#1140)
* Fix a bug where `basilisp.core/time` would fail to expand with `macroexpand-all` in a nested macro call (#1143)

## [v0.3.2]
### Added
Expand Down
4 changes: 2 additions & 2 deletions src/basilisp/core.lpy
Original file line number Diff line number Diff line change
Expand Up @@ -4078,11 +4078,11 @@
"Time the execution of ``expr``\\. Return the result of ``expr`` and print the time
execution took in milliseconds."
[expr]
`(let [start (perf-counter)]
`(let [start# (perf-counter)]
(try
(do ~expr)
(finally
(println (* 1000 (- (perf-counter) start)) "msecs")))))
(println (* 1000 (- (perf-counter) start#)) "msecs")))))

;;;;;;;;;;;;;;;;;;;;;;
;; Threading Macros ;;
Expand Down

0 comments on commit 52f2c21

Please sign in to comment.