[racket] drracket and arity checks

From: Erik Pearson (erik at adaptations.com)
Date: Fri Oct 18 16:38:11 EDT 2013

Thanks, Robby, that was it! Disabling "Preserve stacktrace (disable some
optimizations)" does the trick. I should have seen that, since I had been
in there fiddling with the debug setting. (At that moment, though, I was
not yet aware that optimization is what triggered arity checking...)

Since in my day to day fumbling I probably need stack trace more than I do
compile time arity checking, I'll probably rely on the raco exe process to
catch these. Still, it would be cool if dr racket did this since it does
seem like a "edit time" type of thing.

Thanks again,
Erik.


On Fri, Oct 18, 2013 at 12:44 PM, Robby Findler <robby at eecs.northwestern.edu
> wrote:

> Could it be that errortrace is interfering with the optimizers ability to
> spot these errors? That is, if you turn on the logging window and turn off
> debugging (in the language dialog), do you then see them? Also, there are
> some checkboxes nearby there that also can affect the optimizer's ability
> (also for the purposes of trading off speed for better error messages when
> runtime errors do occur).
>
> Robby
>
>
> On Fri, Oct 18, 2013 at 2:30 PM, Erik Pearson <erik at adaptations.com>wrote:
>
>> Hi, I saw the recent question regarding arity mismatch reporting, but
>> have a more pointed question for drracket usage.
>>
>> I can get a warning message from racket (command line tool) with the "-W
>> warning" option, and from drracket by opening the log view and filtering by
>> warning. However, in drracket I need to do something like create an
>> executable in order to generate the warning, a simple press of the Run
>> button doesn't do it. It appears that a simple "load" in cli "racket -W
>> warning" does invoke the optimizer, so I guess that is not what drracket
>> does (or does in a different way.)
>>
>> So, is a way to get drracket to invoke the optimizer (or do a full load
>> of the file) or do whatever magic needs to be done when the Run button is
>> pressed to generate the warnings? I could use emacs, but drracket is such a
>> low-stress, enjoyable mode of working, especially on smallish files.
>>
>> Before delivering apps I do a raco exe, raco distribute so I can get this
>> done somewhere in the workflow, it would just be nice to get those pesky
>> little arity things squashed early in the development cycle. I'm using a
>> lot of json data extraction and manipulation now, and like the *-ref
>> functions the functions I'm using have a default value in case the hash key
>> or list position is not found. It is easy to leave off the default value
>> and not have it crop up until the app is run. Ouch! My functions require
>> the default value argument, just so I can ensure that something is done to
>> handle missing data, and thus the arity check is handy to ensure that this
>> argument is indeed coded.
>>
>> Yes, and I'm learning TR, and am starting to work on TR adapters for
>> racket libs and my own, which will help. But for more ad-hoc apps which may
>> never be TR, the drracket assistance is welcome.
>>
>> Thanks,
>> Erik.
>>
>> ____________________
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>>
>>
>


-- 
Erik Pearson
Adaptations
;; web form and function
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131018/f5fca473/attachment.html>

Posted on the users mailing list.