Re: [racket-users] Reporting exceptions as though they came from the caller

2017-03-31 Thread Matthew Butterick
> On Mar 31, 2017, at 1:00 PM, David Storrs wrote: > > In Perl I can use caller() [1] to access the stack so that I can have _baz > report errors as though the error were coming from 'foo' or 'bar' as > appropriate -- which is what the user expects to see, since their

Re: [racket-users] Reporting exceptions as though they came from the caller

2017-03-31 Thread WarGrey Gyoudmon Ju
I use continuation marks to extract the nearest named function (named loops are also contained in the context): (define-syntax (#%function stx) ; class method has a symbol name looks like "[name] method in [class%]" #'(let use-next-id : Symbol ([stacks (continuation-mark-set->context

Re: [racket-users] Reporting exceptions as though they came from the caller

2017-03-31 Thread Jon Zeppieri
On Fri, Mar 31, 2017 at 4:00 PM, David Storrs wrote: > Imagine I have the following trivial module (ignore that things are defined > out of sequence for clarity): > > #lang racket > > (define (foo arg) > (_baz arg) ; do some checking, raise an exception if there's a

Re: [racket-users] Reporting exceptions as though they came from the caller

2017-03-31 Thread Ryan Culpepper
On 03/31/2017 04:00 PM, David Storrs wrote: Imagine I have the following trivial module (ignore that things are defined out of sequence for clarity): #lang racket (define (foo arg) (_baz arg) ; do some checking, raise an exception if there's a problem ...do stuff... ) (define (bar

[racket-users] Typing lag with DrRacket on Linux

2017-03-31 Thread Dave Musicant
Hey folks, I'm using DrRacket on a 64-bit Ubuntu 16.04 system with the default Unity windowing system, and am finding that typing in the definitions window is laggy. The problem isn't a show-stopper, as it keeps up more or less as I type, but it's disorienting. I teach a class using DrRacket,

Re: [racket-users] how to `read-char` from port using `latin-1` encoding?

2017-03-31 Thread Matthew Butterick
OK thanks. Both "latin1" and "iso-8859-1" do work with `reencode-input-port`. > On Mar 31, 2017, at 1:08 PM, Jon Zeppieri wrote: > > Try using "iso-8859-1" as the name of the encoding, instead of "latin-1." -J > > > On Fri, Mar 31, 2017 at 3:55 PM, Matthew Butterick

Re: [racket-users] how to `read-char` from port using `latin-1` encoding?

2017-03-31 Thread Jon Zeppieri
Try using "iso-8859-1" as the name of the encoding, instead of "latin-1." -J On Fri, Mar 31, 2017 at 3:55 PM, Matthew Butterick wrote: > IIUC when `read-char` reads from a port it assumes the port uses UTF-8 > encoding. [1] > > (My Racketuition suggests there might be a

Re: [racket-users] how to `read-char` from port using `latin-1` encoding?

2017-03-31 Thread Matthew Flatt
Try "latin1" (no hyphen). I'm not sure of the standard for these names, but probably Racket's `latin-1` functions are misnamed. > On Mar 31, 2017, at 3:55 PM, Matthew Butterick wrote: > > IIUC when `read-char` reads from a port it assumes the port uses UTF-8 > encoding. [1]

[racket-users] Reporting exceptions as though they came from the caller

2017-03-31 Thread David Storrs
Imagine I have the following trivial module (ignore that things are defined out of sequence for clarity): #lang racket (define (foo arg) (_baz arg) ; do some checking, raise an exception if there's a problem ...do stuff... ) (define (bar arg) (_baz arg) ; do some checking, raise