Re: [racket-users] How to limit memory usage and raise out-of-memory error?

2018-08-10 Thread Shu-Hung You
Cool! That does the job. Thank you. On Fri, Aug 10, 2018 at 3:57 PM, Matthew Flatt wrote: > For the second part, use `thread/suspend-to-kill` to create a thread > that is merely suspended when its custodian is shut down, and then you > can use `(continuation-marks thread-id)` to get the thread's

Re: [racket-users] How to limit memory usage and raise out-of-memory error?

2018-08-10 Thread Matthew Flatt
For the second part, use `thread/suspend-to-kill` to create a thread that is merely suspended when its custodian is shut down, and then you can use `(continuation-marks thread-id)` to get the thread's continuation marks at the point where it was suspended. You'll need to wait until either the thre

[racket-users] How to limit memory usage and raise out-of-memory error?

2018-08-10 Thread Shu-Hung You
I'm running a thread with memory limit using custodian-limit-memory. How do I reliably detect whether the thread I'm running was terminated normally or aborted by custodian shutdown? Plus, is it possible to obtain the context at the time the memory limit was exceeded? I can think these two: 1. Us

Re: [racket-users] Recommendation for learning syntax?

2018-08-10 Thread Matthias Felleisen
> On Aug 10, 2018, at 1:02 PM, Eric Griffis wrote: > > A few months ago, I was similarly confused. Here's what I remember > learning since then. > > Let's call the character-level syntax of a language concrete and any > higher-level syntax abstract. By these definitions, a parser makes > concr

[racket-users] Re: how to show raco full (non-abbreviated) error messages

2018-08-10 Thread Wolfgang Hukriede
Hi Sam, okay, this is not exactly raco. I mean e.g. this snippet: given procedure: ...amm-3.1/util.scm:58:6 in map: argument mismatch; the given procedure's expected number of arguments does not match the given number of lists given procedure: ...amm-3.1/util.scm:58:6 expected: 2 giv

Re: [racket-users] how to show raco full (non-abbreviated) error messages

2018-08-10 Thread Sam Tobin-Hochstadt
Can you give an example of what you mean? My guess is that you mean that `raco setup` prints an abbreviated form of the errors at the end of the run, but it also prints the full error message when it's encountered. Sam On Fri, Aug 10, 2018 at 2:58 PM, Wolfgang Hukriede wrote: > hi, > > subject

[racket-users] how to show raco full (non-abbreviated) error messages

2018-08-10 Thread Wolfgang Hukriede
hi, subject says it all. I think it's a nuisance to cripple error messages instead of just showing them. What's more, quite often emacs cannot find the location then. thanks, see you -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubsc

Re: [racket-users] Recommendation for learning syntax?

2018-08-10 Thread Eric Griffis
A few months ago, I was similarly confused. Here's what I remember learning since then. Let's call the character-level syntax of a language *concrete* and any higher-level syntax *abstract*. By these definitions, a *parser* makes concrete syntax abstract, and an *interpreter* translates one piece

Re: [racket-users] Is it possible to embed a scheme'y text editor in another GUI application?

2018-08-10 Thread Christopher Lemmer Webber
David Thrane Christiansen writes: >> Wow, those are stunning examples! I had no idea! > > Thanks! > >> BTW, do you have code for either of these posted anywhere under a libre >> license? Might be interesting to look at :) > > I don't typically post the source code of the slides themselves, > bec

[racket-users] Re: parser-tools/lex

2018-08-10 Thread Zeta Convex
On Friday, 10 August 2018 13:57:18 UTC+1, Zeta Convex wrote: > > I'm trying to match anything that isn't a tab or space, but I end up > matching nearly everything. > Ah, I think I just figured it out. I need to replace >*[(:+ (complement (:or #\Tab #\Space)))* > with [(+(char-complemen

[racket-users] parser-tools/lex

2018-08-10 Thread Zeta Convex
I'm trying to match anything that isn't a tab or space, but I end up matching nearly everything. Here's a snip from the code: (define tsv-lexer (lexer [(eof) 'EOF] [#\space (tsv-lexer input-port)] [#\tab (tsv-lexer input-port)] *[(:+ (complement (:or #\Tab #\Space)))* (begin

Re: [racket-users] how to display all paths of a tree without repetitions

2018-08-10 Thread Robert Girault
On Sun, Aug 5, 2018 at 3:40 PM Matthias Felleisen wrote: > I“d write it like this: > > (struct tree (val left right) #:transparent) > ;; Tree = '() | (tree X Tree Tree) > > (define (printer t0) > (local (;; from-t0 : the path from t0 to t > (define (printer/acc t from-t0) >