HackerTrans
TopNewTrendsCommentsPastAskShowJobs

rogerkeays

no profile record

Submissions

Re-Evaluating GPT-4's Bar Exam Performance

link.springer.com
122 points·by rogerkeays·2 yıl önce·137 comments

[untitled]

1 points·by rogerkeays·2 yıl önce·0 comments

Unchecked Java: Say goodbye to checked exceptions

github.com
143 points·by rogerkeays·3 yıl önce·291 comments

comments

rogerkeays
·2 yıl önce·discuss
Andrews PW, Thomson JA Jr. The bright side of being blue: depression as an adaptation for analyzing complex problems. Psychol Rev. 2009 Jul

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2734449/
rogerkeays
·3 yıl önce·discuss
Good point. Actually the plugin didn't handle this case either (fixed now). Thanks for the feedback.
rogerkeays
·3 yıl önce·discuss
You don't think it would limit the independent use of f()?
rogerkeays
·3 yıl önce·discuss
This language looks really cool. Thanks for sharing.
rogerkeays
·3 yıl önce·discuss
You can also rethrow checked exceptions as runtime exceptions by exploiting type erasure:

    public static RuntimeException unchecked(Exception e) {
        Exceptions.<RuntimeException>throw_checked(e); 
        return null; 
    }
    private static <E extends Exception> void throw_checked(Exception e) throws E {
        throw (E) e;
    }
then you can do this:

    try { ...
    } catch (IOException e) {
        throw unchecked(e);
    }
And the original exception is thrown without being wrapped. It's as though you had `throws IOException` on your method signature.

This is from my original solution to the problem: https://github.com/rogerkeays/jamaica-core/blob/0cc98b114998...
rogerkeays
·3 yıl önce·discuss
... not sure if serious or not
rogerkeays
·3 yıl önce·discuss
I put Java's popularity down to good support for Corporate-Oriented Programming ;)
rogerkeays
·3 yıl önce·discuss
You still get warnings about checked exceptions from this plugin, so it's not entirely flying blind.
rogerkeays
·3 yıl önce·discuss
I think this project shows how trivial it is to convert checked exception errors to compiler warnings.

https://github.com/rogerkeays/unchecked/blob/f22c8cde3557de0...

No need to change the type hierarchy. Just make it a compiler option.
rogerkeays
·3 yıl önce·discuss
Good point...
rogerkeays
·3 yıl önce·discuss
Ha, yeh. At first I had the command line examples first, but everyone was going on and on about maven and stuff, so I figured that's what the audience wants.

[EDIT] I moved the command line stuff back to the top of the README. XML makes my eyes bleed too...