debug builds

Description

This ticket includes two patches:

  1. a patch to set assert when clojure.lang.RT loads, based on the presence of system property clojure.debug

  2. expand error messages in assert to include local-bindings</code> (a new macro which wraps the implicit <code>&env)

Things to consider before approving these patches:

  1. should there be an easy Clojure-level way to query if debug is enabled? (checking assert isn't the same, as debug should eventually drive other features)

  2. assertions will now be off by default – this is a change!

  3. is the addition of the name local-bindings to clojure.core cool?

Environment

None

Activity

Show:

importOctober 23, 2013 at 9:12 AM

Comment made by: lopusz

Btw. there is a library for runtime-toggable assertions available via clojars
https://github.com/pjstadig/assertions
This helped me a great deal.

importOctober 11, 2013 at 10:21 AM

Comment made by: lopusz

I am also interested in any news on this issue.
Convenient way to enable/disable assertions at runtime (preferably via -ea/-da options) would be a great feature!

Alexander KielMarch 14, 2013 at 7:28 PM

Is there anything new on this issue? I also look for a convenient way to disable assertions in production.

Stuart HallowayJanuary 7, 2011 at 3:57 PM

Link: Google "java assert shirazi". (Not posting link because I can't tell in 10 secs whether it includes my session information.)

Stuart HallowayJanuary 7, 2011 at 3:51 PM

  1. Yes, in static init code

  2. There is no special support in the classloader, per Brian Goetz (private correspondence) last week. But dead code elimination is great: "The run-time cost of disabled assertions should indeed be zero for compiled code"

Details

Assignee

Reporter

Labels

Approval

Vetted

Priority

Affects versions

Fix versions

Created January 27, 2010 at 11:40 PM
Updated October 23, 2013 at 9:12 AM