Re: [racket-users] Performance of the Racket reader

2017-06-01 Thread Steve Byan's Lists
> On Jun 1, 2017, at 10:52 AM, Steve Byan's Lists <steve-l...@byan-roper.org> > wrote: > > Hi Jon, > >> On May 31, 2017, at 6:41 PM, Steve Byan's Lists <steve-l...@byan-roper.org> >> wrote: >> >>> On May 31, 2017, at 6:14 PM, Jon Zeppi

Re: [racket-users] Performance of the Racket reader

2017-06-01 Thread Steve Byan's Lists
Hi Jon, > On May 31, 2017, at 6:41 PM, Steve Byan's Lists <steve-l...@byan-roper.org> > wrote: > >> On May 31, 2017, at 6:14 PM, Jon Zeppieri <zeppi...@gmail.com> wrote: >> >> So, for example: >> >> (define (map-trace stat%-set in-port)

Re: [racket-users] Performance of the Racket reader

2017-06-01 Thread Steve Byan's Lists
> On Jun 1, 2017, at 12:25 AM, Neil Van Dyke <n...@neilvandyke.org> wrote: > > Steve Byan's Lists wrote on 05/31/2017 10:05 PM: >> I'd appreciate a short example of what you mean by using `apply` and >> `lambda` to destructure the list. > > I'll babble more t

Re: [racket-users] Performance of the Racket reader

2017-05-31 Thread Steve Byan's Lists
Hi Neil, Thanks for the comments. > On May 31, 2017, at 8:21 PM, Neil Van Dyke wrote: > > In addition to what others have mentioned, at this scale, you might get > significant gains by adjusting your s-expression language. > > For example, instead of this: > >

Re: [racket-users] Performance of the Racket reader

2017-05-31 Thread Steve Byan's Lists
> On May 31, 2017, at 6:32 PM, Matthias Felleisen wrote: > >> >> On May 31, 2017, at 6:14 PM, Jon Zeppieri wrote: >> >> >> This way, you don't build up a list or a lazy stream; you just process >> each datum as it's read. > > > Yes, that’s what I

Re: [racket-users] Performance of the Racket reader

2017-05-31 Thread Steve Byan's Lists
Hi Jon, > On May 31, 2017, at 6:14 PM, Jon Zeppieri <zeppi...@gmail.com> wrote: > > On Wed, May 31, 2017 at 5:54 PM, Steve Byan's Lists > <steve-l...@byan-roper.org> wrote: >> So, I don't want to try to fit all the records in memory at once. I thought >> t

Re: [racket-users] Performance of the Racket reader

2017-05-31 Thread Steve Byan's Lists
Hi Mathias, Thanks for taking a look. > On May 31, 2017, at 4:13 PM, Matthias Felleisen wrote: > > > Can you explain why you create a lazy stream instead of a plain list? The current size of a short binary trace file is about 10 GB, and I want to scale to traces many

[racket-users] Performance of the Racket reader

2017-05-31 Thread Steve Byan's Lists
I've written a command-line tool in Racket to analyze the files produced by a tool that traces accesses to persistent memory by an application. The traces are large: about 5 million records per second of application run time. While developing the tool in Racket was a pleasant, productive, and

Re: [racket-users] Re: Functional object-oriented programming

2017-02-08 Thread Steve Byan's Lists
> On Feb 8, 2017, at 9:05 PM, Philip McGrath wrote: > Personally, I tend to end up defining helper functions to do functional > update (often with optional keyword arguments to address the > fields-that-stay-the-same issue). Generics in the sense of racket/generic can

Re: [racket-users] Re: Functional object-oriented programming

2017-02-08 Thread Steve Byan's Lists
Matthias, thanks for the confirmation that macros are the answer. Yes, mutation could be simpler. I'm learning more doing it functionally. Alex, thanks for pointing out struct-copy. I hadn't read that part of the Racket Guide yet. Would it be possible to write a macro that when invoked within

[racket-users] Functional object-oriented programming

2017-02-08 Thread Steve Byan's Lists
I'm just learning Racket's object system. I feel like I've missed something, as it seems pretty verbose to functionally update objects. The pattern I use when functionally updating object state is to invoke the class constructor with a full set of arguments, some subset of which have updated

Re: [racket-users] read from stdin, except when run in DrRacket

2017-02-08 Thread Steve Byan's Lists
> On Feb 8, 2017, at 2:06 PM, Matthias Felleisen wrote: > > > I thought of giving this answer too, but if this is about testing let me > propose a slightly different approach: Thanks. By "testing" I meant flailing around in the REPL while I a) learn Racket and b)

Re: [racket-users] read from stdin, except when run in DrRacket

2017-02-08 Thread Steve Byan's Lists
> On Feb 8, 2017, at 2:02 PM, Ben Greenman wrote: > > One idea: you can put the argument-parsing code in the "main" submodule, then > tell DrRacket not to run the main submodule. [snip] > Then in DrRacket, click "Language -> Choose Language -> Show Details -> >

[racket-users] read from stdin, except when run in DrRacket

2017-02-08 Thread Steve Byan's Lists
I'm working on a script that I eventually plan to invoke from the command line. I'd like the script to either take a file name argument or, if no arguments, read from stdin. However, while developing the script in DrRacket, I'd like to not invoke the top-level function, and to instead define an

Re: [racket-users] math/statistics running expected values

2017-01-27 Thread Steve Byan's Lists
Hi Jack, > On Jan 27, 2017, at 3:57 PM, Jack Firth wrote: > > I don't have enough stats experience to help with the details of your > problem, but I'd like to suggest adding a separate package that extends > math/statistics. You'll likely have an easier time developing

[racket-users] math/statistics running expected values

2017-01-27 Thread Steve Byan's Lists
Thanks for the excellent statistics library, especially the on-line algorithms for the statistics object. However, I often need to partition a large population into subsets, obtain the statistics of each subset, and obtain the statistics of various unions of the subsets as well as for the

Re: [racket-users] class copy constructors

2017-01-26 Thread Steve Byan's Lists
Never mind, I got it: (define baz% (class object% (init (foo 0)) (define bar foo) (super-new) (define/public (get-bar) bar) (define/public (copy-baz) (new baz% [foo (+ (get-bar) 2)] > (define a (new baz%)) > (send a get-bar) 0 > (define b (send a copy-baz))

[racket-users] class copy constructors

2017-01-26 Thread Steve Byan's Lists
I'm trying to make some simple use of Racket's class and object system, but I'm having trouble using the documentation to figure out how to accomplish something. I want to create both a no-argument default constructor and a copy-constructor. I don't see how to accomplish that. If I declare an