Re: [racket-users] Custom repl UI widgets

2015-03-26 Thread Matthew Flatt
At Wed, 25 Mar 2015 17:08:56 -0700 (PDT), Steve Olsen wrote: I was wondering if anybody could show me an example of a very simple snip% that maybe drew a circle and had some sort of click interaction that I could work off of. I'll add the enclosed example to the documentation. -- You

Re: [racket-users] Self contained executables

2015-03-27 Thread Matthew Flatt
At Fri, 27 Mar 2015 16:42:03 -0700 (PDT), John Carmack wrote: I want to be able to build simple (windows) utilities for other team members that don't have Racket installed. The archive-with-dlls option is better than nothing, but it would be a whole lot better to have a single statically

Re: [racket-users] modifying readtable entry for `(` breaks reading #hash() ?

2015-04-13 Thread Matthew Flatt
that, then why should it care whether the readtable entry for `(` is exactly the same as the default? On Apr 13, 2015, at 1:00 PM, Matthew Flatt mfl...@cs.utah.edu wrote: The reader for `#hash` parses parentheses and dots itself, instead of recurring and checking the result, so that it can

Re: [racket-users] Environment Shuffling and 3D Syntax

2015-05-07 Thread Matthew Flatt
. At Thu, 7 May 2015 07:29:48 -0700 (PDT), Philip Blair wrote: On Wednesday, May 6, 2015 at 11:02:33 PM UTC-4, Matthew Flatt wrote: I wonder whether whether expanding to `module+` might be a better direction. A rough expansion of your example might be #lang racket/base (module+ FOO

Re: [racket-users] Scribble: para without indentation for LaTeX/PDF output

2015-05-07 Thread Matthew Flatt
(Sorry for the long delay!) I think that defining a paragraph style for Latex is the right answer to avoid indentation. In case you haven't yet done that, here's a hack: use `(elem #:style noindent)` as the first element of of the paragraph. That works because it generates `\noindent` in the

Re: [racket-users] Fully-expanding a define form in its definition context

2015-05-07 Thread Matthew Flatt
The problem that you're hitting is that the `#%module-begin` form of `racket` forces partial expansion of the module body to detect definitions before it proceeds to expand expressions. That's why `define-values` complains about a full expansion in context; it's not supposed to be fully expanded,

Re: [racket-users] scribble namespace landgrab embedded package documentation

2015-05-07 Thread Matthew Flatt
I have no problem with these names --- the `scribble` exports are unlikely to ever collide, since we rarely resort to capital letters --- but I can't help thinking that the language of the metadata should specified explicitly. Concretely, instead of #lang racket/base maybe the file should

Re: [racket-users] write-bytes specification

2015-05-06 Thread Matthew Flatt
At Wed, 06 May 2015 22:32:53 -0400, Neil Van Dyke wrote: If I call `write-bytes` with mutable byte string S with value A, and then, immediately after return from the call, I mutate S to value B... is it nevertheless guaranteed that value A will be written? Yes. I'll adjust the docs to

Re: [racket-users] Environment Shuffling and 3D Syntax

2015-05-10 Thread Matthew Flatt
ideas? On Thu, May 7, 2015 at 2:33 PM, Matthew Flatt mfl...@cs.utah.edu wrote: I agree that those sound goals sound like a poor fit for `module+`. It's possible that `racket/package` provides something closer to the namespace-management tools that you need. Generally, I think you'll find

Re: [racket-users] Time for draw-bitmap

2015-05-10 Thread Matthew Flatt
If you're on OS X, try creating the bitmap with (send canvas make-bitmap screen-width screen-height) instead of (make-object bitmap% screen-width screen-height) Roughly, using the `make-bitmap` method creates a bitmap that's on the graphics card instead of main memory. At Sun, 10 May 2015

Re: [racket-users] Time for draw-bitmap

2015-05-10 Thread Matthew Flatt
At Mon, 11 May 2015 00:30:05 +0200, Jens Axel Søgaard wrote: 2015-05-11 0:07 GMT+02:00 Matthew Flatt mfl...@cs.utah.edu: If you're on OS X, try creating the bitmap with (send canvas make-bitmap screen-width screen-height) instead of (make-object bitmap% screen-width screen

Re: [racket-users] Why doesn't my readtable extension work in the REPL?

2015-05-11 Thread Matthew Flatt
At Mon, 11 May 2015 13:22:31 -0700, Alexis King wrote: I’ve gotten my curly-fn meta-language https://github.com/lexi-lambda/racket-curly-fn working, and it works great within a module. However, evaluating #{+ 2} within the REPL just evaluates as a plain old vector, ignoring my readtable

Re: [racket-users] pkg-build report for the v6.2 release candidate

2015-05-17 Thread Matthew Flatt
At Fri, 15 May 2015 13:17:57 -0700, John Clements wrote: On May 14, 2015, at 4:08 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Here are the results of a package build using the v6.2 release candidate: http://release-pkg-build.racket-lang.org.s3-website-us-west-2.amazonaws.com

[racket-users] pkg-build report for the v6.2 release candidate

2015-05-14 Thread Matthew Flatt
Here are the results of a package build using the v6.2 release candidate: http://release-pkg-build.racket-lang.org.s3-website-us-west-2.amazonaws.com/ Compare to v6.1.1: http://pkg-build.racket-lang.org/ For the v6.2 candidate, there are lots of dependency failures related to documentation,

Re: [racket-users] Environment Shuffling and 3D Syntax

2015-05-15 Thread Matthew Flatt
At Fri, 15 May 2015 11:09:25 -0400, Philip Blair wrote: One question I have is whether or not the scopes feature is something which I can more or less count on being available in future versions of Racket That's not yet clear. Although most existing code would be unaffected by the change to a

Re: [racket-users] racket testing on openwrt

2015-05-18 Thread Matthew Flatt
At Mon, 18 May 2015 07:16:39 -0400, Jay McCarthy wrote: On Sun, May 17, 2015 at 5:00 PM, Neil Van Dyke n...@neilvandyke.org wrote: Can someone recommend an easy way to test Racket 9.2 pre-release on OpenWrt (embedded GNU/Linux, running on a normal home WiFi router)? For example, is there

Re: [racket-users] modifying readtable entry for `(` breaks reading #hash() ?

2015-04-15 Thread Matthew Flatt
At Tue, 14 Apr 2015 21:04:38 -0400, Alexander D. Knauth wrote: On Apr 14, 2015, at 6:57 PM, Matthew Flatt mfl...@cs.utah.edu wrote: This is the kind of problem that the readtable argument to `read/recursive` was meant to solve, but I see that it doesn't work in this case. I have

Re: [racket-users] Mutually recursive struct pointers in FFI?

2015-04-15 Thread Matthew Flatt
I don't think you're missing anything. I don't often run into this problem, maybe because libraries I've used tend to keep structs private. When the problem does show up, I have resorted to using `_pointer`, too. At Tue, 14 Apr 2015 17:04:38 -0700 (PDT), Ian Johnson wrote: I'm trying to

Re: [racket-users] raco make, file permissions, and unstable directories

2015-04-16 Thread Matthew Flatt
A potential problem with copying files is that the timestamps can get out of sync. You'll want to make sure that timestamps on the .zo files stay newer than the timestamps on the .rkt sources. At Thu, 16 Apr 2015 02:03:31 -0500, Robby Findler wrote: 1) Compilation to .zo files (what raco make

Re: [racket-users] modifying readtable entry for `(` breaks reading #hash() ?

2015-04-13 Thread Matthew Flatt
The reader for `#hash` parses parentheses and dots itself, instead of recurring and checking the result, so that it can provide better error reporting. For example, if I write #hash((x . 1) y (z . 2)) then the reader can highlight y and complain about that part specifically. If the `#hash`

Re: [racket-users] question about read/recursive

2015-04-11 Thread Matthew Flatt
Unlike setting `current-readtable`, the readtable that you pass to `read/recursive` applies only for the next thing in the input (roughly, the processing of the next character). For example, suppose you want `$` to be the same as `@` if it's followed by a `(`, but you don't want to change the

Re: [racket-users] modifying readtable entry for `(` breaks reading #hash() ?

2015-04-14 Thread Matthew Flatt
)) still reads as ((x . 1) y (z . 2)). But does this mean that I can’t read hash-tables with this? Or is there a way around it without reimplementing #hash, #hasheq, etc.? Alex Knauth On Apr 13, 2015, at 4:40 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Ok, I oversimplified

Re: [racket-users] Applying functions to mutable lists

2015-04-09 Thread Matthew Flatt
At Thu, 9 Apr 2015 08:22:12 -0700 (PDT), Jerry Jackson wrote: The compatibility/mlist module has lots of support functions but I'd like to be able to apply racket functions to the lists I've constructed and I don't see any mapply. I understand that the use of mutable cons cells is discouraged

Re: [racket-users] slideshow keyboard callbacks?

2015-05-19 Thread Matthew Flatt
I don't think keybinding support or slide-changing operations are there already. My guess is that they'd be easy to add. At Tue, 19 May 2015 19:30:35 -0700, 'John Clements' via users-redirect wrote: I’m creating a simple slideshow, and I’d like to be able to jump to a given slide instantly,

[racket-users] DLS-15, CFP

2015-05-19 Thread Matthew Flatt
...@easychair.org Program committee Carl Friedrich Bolz, DE William R. Cook, UTexas, USA Jonathan Edwards, MIT, USA John Field, Google, USA Matthew Flatt, USA Elisa Gonzalez Boix, Vrije Universiteit, BE Robert Hirschfeld, Hasso-Plattner-Institut Potsdam, DE Benjamin Livshits

Re: [racket-users] Re: Implementing a lazy for/stream using for/fold/derived and delimited control

2015-05-20 Thread Matthew Flatt
At Tue, 19 May 2015 20:33:57 -0700, Alexis King wrote: As I've continued to experiment with this, I've run into something that I don't really understand. I've managed to come up with this snippet of code. (define (do prompt-tag) (define (loop element continue) (if continue

Re: [racket-users] RACO : how to build a shared fPIC library?

2015-05-20 Thread Matthew Flatt
As you say, you can build the Racket executable using shared libraries by configuring with `--enable-shared`. Then, when you create an executable with `raco exe`, you end up with a smaller executable that refers to the shared libraries. I'm not sure how much that will save, since an executable

Re: [racket-users] Strange behavior when writing to a file

2015-06-02 Thread Matthew Flatt
If you uncomment the redirects to stdout and comment out the file output, then nothing is written to the file, so that changes the content of `(file-lines soap-file)` the second time around. I think you wanted `(and (=` in place of `(or (`. At Tue, 02 Jun 2015 15:25:07 -0400, Mark Lee wrote: To

Re: [racket-users] strange bug with racket/gui

2015-06-02 Thread Matthew Flatt
The documentation's discussion of drawing in a canvas may be helpful: http://docs.racket-lang.org/gui/canvas___.html There was also a similar thread on this list in January, and the exampe code I posted then may be helpful: http://lists.racket-lang.org/users/archive/2015-January/065764.html

Re: [racket-users] defform quastion

2015-06-04 Thread Matthew Flatt
You can use `code:line` to group terms without parentheses: (code:line addition + term) At Thu, 4 Jun 2015 16:53:33 +0200, Jos Koot wrote: Hi, I have tried to use defform of scribble to describe the following: syntax ($ infix-expr) → any infix-expr ::= addition addition ::=

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Matthew Flatt
Science 115 Waterman St, 4th Floor Providence, RI 02912 802-458-0637 On Mon, Jun 22, 2015 at 11:39 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Probably you don't want to work with namespaces, which are intended more for run-time reflection. For an example of turning internal definitions

Re: [racket-users] drawing with canvas

2015-06-22 Thread Matthew Flatt
The docs here might help elaborate on Matthias's answer: http://docs.racket-lang.org/gui/canvas___.html I'll try adding more links to that information, including from the `get-dc` method. Maybe it also would be better as its own section in the overview chapter. At Mon, 22 Jun 2015 18:07:04

Re: [racket-users] Closing big-bang windows

2015-06-21 Thread Matthew Flatt
The enclosed big-crunch.rkt library provides a `big-bang/big-crunch` form that is the same as `big-bang`, but it closes the window with `stop-when` produces #t. (I wrote it for my son.) ;; isl+ (require 2htdp/image) (require 2htdp/universe) (require big-crunch.rkt) (big-bang/big-crunch 10

Re: [racket-users] try a new macro expander

2015-06-24 Thread Matthew Flatt
I rely on it in this macro here: https://github.com/AlexKnauth/my-object/blob/master/my-object/stuff.rkt#L25 And Travis CI was giving me this error: https://travis-ci.org/AlexKnauth/my-object/jobs/68248192#L209 On Jun 22, 2015, at 8:25 AM, Matthew Flatt mfl...@cs.utah.edu wrote: At Thu

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-22 Thread Matthew Flatt
Probably you don't want to work with namespaces, which are intended more for run-time reflection. For an example of turning internal definitions into 'letrec-syntaxes+values', try the implementation of 'racket/block'. On Jun 23, 2015, at 10:06 AM, Thomas Dickerson thomas_dicker...@brown.edu

Re: [racket-users] try a new macro expander

2015-06-22 Thread Matthew Flatt
At Thu, 21 May 2015 07:15:14 -0600, Matthew Flatt wrote: Otherwise, be prepared for me to come back in a few weeks and lobby for moving to a new macro expander. Here's the proposal: let's switch on July 16. Switch means that I'd merge the new macro expander to the master branch

Re: [racket-users] Racket modules in R6RS?

2015-06-11 Thread Matthew Flatt
At Thu, 11 Jun 2015 20:22:16 +, John Carmack wrote: How do you include a racket module in an R6RS program? I have remote.rkt in the same directory as test.scm. With R5RS I could do (#%require remote.rkt), but that doesn't work, and I tried various things in the (import) statement

Re: [racket-users] System Scheme (RnRS): Shared Secret Generator

2015-06-11 Thread Matthew Flatt
At Wed, 10 Jun 2015 18:44:15 +0200, Michael Titke wrote: On 10/06/2015 12:33, Michael Titke wrote: I changed from one OS to another and I was missing a simple feature: automatic password generation. To fill the gap with a Scheme I implemented such a generator as a command line tool

Re: [racket-users] DrRacket rendering issues OS X

2015-06-17 Thread Matthew Flatt
At Wed, 17 Jun 2015 12:35:36 -0700 (PDT), Andrew Kent wrote: On Wednesday, June 17, 2015 at 3:10:51 PM UTC-4, Alex Knauth wrote: One data point: I’m using DrRacket version 6.2.0.4--2015-06-08 with OS X Version 10.9.5, and if I remember correctly it was a Racket plus Tests 64-bit

Re: [racket-users] racket on android (Was: Racket modules in R6RS?)

2015-06-11 Thread Matthew Flatt
Android via NDK is a supported platform. The src/README file has information on cross-compilation and specific hints for Android. I'm not in a position to double check just now, but it built the last time I tried a few months ago. Embedding should be as easy as on any platform. I wouldn't

Re: [racket-users] terminal emulator

2015-06-04 Thread Matthew Flatt
At Wed, 3 Jun 2015 16:46:09 -0600, William G Hatch wrote: Its main problem currently is that it spends a lot of time drawing. I am using a canvas% and I override its dc%'s on-paint to get the contents and then draw them on screen. I call the refresh method to queue a re-paint whenever I get

Re: [racket-users] truncated text-outline rendering on dc-path%

2015-05-29 Thread Matthew Flatt
I've pushed a repair for `text-outline` in the draw-lib package. The implementation of `text-outline` used a small bitmap to accumulate the path, and Cairo apparently discards paths that are far enough outside the bitmap's region. The revised implementation uses a recording surface, instead, to

Re: [racket-users] try a new macro expander

2015-06-29 Thread Matthew Flatt
.: ; = add matching binding.: ; matching binding.: in: add1 I found this because of this Travis CI build failure: https://travis-ci.org/AlexKnauth/infix-macro/jobs/68245124#L164 On Jun 25, 2015, at 12:31 AM, Matthew Flatt mfl...@cs.utah.edu wrote: Yes, I overlooked `splicing-local`, and I'll

Re: [racket-users] Using ‘except-in’ to exclude identifiers for a single phase level

2015-06-29 Thread Matthew Flatt
You're right that there's not a form that's like `except-out` but constrained both by name and phase. There's also not an export variant of `only-meta-in`, which would get your half-way there. You could implement a new provide expander to do that. Otherwise, in addition to the strategy that you

Re: [racket-users] garbage collection

2015-07-04 Thread Matthew Flatt
I have no plans myself, but I think many applications would benefit from incremental collection. I also think that implementing an incremental GC for Racket is within reach --- as much as for any runtime system. That is, unlike so many other things in our infrastructure, the GC is not so tangled

Re: [racket-users] garbage collection

2015-07-05 Thread Matthew Flatt
At Sat, 04 Jul 2015 17:55:29 -0400, Neil Van Dyke wrote: Neil Toronto wrote on 07/04/2015 05:29 PM: I don't know, but I want most of these things. I assume this is related to your earlier question about games? :) Partly. :) I've also been dealing with GC for years in non-game HTTP

Re: [racket-users] stops in Macros that Work Together

2015-07-06 Thread Matthew Flatt
At Mon, 06 Jul 2015 23:24:20 -0400, Ryan Culpepper wrote: On 07/06/2015 10:04 PM, Anthony Carrico wrote: I've been working through Macros that Work Together (on my way to working through Sets-of-Scopes). I've come across something that is slightly unclear to me in the section on

Re: [racket-users] exn-string

2015-05-24 Thread Matthew Flatt
A new module sounds right to me. I was thinking `racket/exn-to-string` for just this function, but `racket/exn` sounds fine and maybe better. At Sun, 24 May 2015 08:01:23 -0400, Jay McCarthy wrote: I think it's a good idea. Where to though? A new racket/exn module? Jay On Sat, May 23, 2015

[racket-users] try a new macro expander

2015-05-21 Thread Matthew Flatt
I've been working on a new model of macros for Racket. The new model provides a simple account of scope, makes reasoning about macros easier, and simplifies the implementation of the macro expander while fixing bugs (e.g., submodules in Typed Racket). You can read more about the model here:

Re: [racket-users] Scribble abstraction to attach styles

2015-05-21 Thread Matthew Flatt
And maybe helpful for the original question: Including `(alt-tag div)` in the property list of your styles produces div in the HTML output instead of blockquote, which is more directly what you want and avoids any default inset of blockquote. At Thu, 21 May 2015 16:52:12 -0400, Shriram

Re: [racket-users] try a new macro expander

2015-05-22 Thread Matthew Flatt
At Thu, 21 May 2015 22:58:04 -0400, Josh Grams wrote: Also, shouldn't the x's under syntax-rules and in the expansion of (m) have a 'b' in their scope sets (since they're in the syntax-rules scope)? Or aren't they? The `let-syntax` form binds only in its body, not the right-hand sides of

Re: [racket-users] test submodules vs tests in separate file

2015-05-22 Thread Matthew Flatt
Adding to the suggestions, you can write something like `test-internal` and `test-external` submodules plus (module+ test (require (submod .. test-internal) (submod .. test-external))) At Fri, 22 May 2015 15:23:33 -0400, Matthias Felleisen wrote: DOn't forget $ raco test

Re: [racket-users] Racket should not cancel an OS shutdown

2015-05-20 Thread Matthew Flatt
It's been a few years since I last looked at this. If I remember correctly, the problem is a mismatch between the `racket/gui` model of eventspaces and the way that shutdown notifications and responses work in Cocoa. The mismatch makes it difficult for `racket/gui` to defer its answer to the OS

Re: [racket-users] Re: Garbage Collection of Places

2015-08-18 Thread Matthew Flatt
At Tue, 18 Aug 2015 10:40:14 -0400, George Neuner wrote: On Mon, 17 Aug 2015 10:07:11 -0600, Matthew Flatt mfl...@cs.utah.edu wrote: The problem is in the clean-up of OS-level locks. A lock is allocated using a combination of malloc() and pthread_mutex_init(), for example. The clean up

Re: [racket-users] Garbage Collection of Places

2015-08-18 Thread Matthew Flatt
At Mon, 17 Aug 2015 12:21:41 -0700 (PDT), Jack Firth wrote: On Monday, August 17, 2015 at 9:07:15 AM UTC-7, Matthew Flatt wrote: That's an especially basic mistake, and it slipped by because low-level locks are rarely allocated in the run-time system. Place channels are probably

Re: [racket-users] DrRacket rendering issues OS X

2015-08-19 Thread Matthew Flatt
PM.png] On Wed, Jun 17, 2015 at 7:13 PM Matthew Flatt mfl...@cs.utah.edu wrote: At Wed, 17 Jun 2015 12:35:36 -0700 (PDT), Andrew Kent wrote: On Wednesday, June 17, 2015 at 3:10:51 PM UTC-4, Alex Knauth wrote: One data point: I’m using DrRacket version 6.2.0.4--2015-06-08 with OS X

Re: [racket-users] Impersonating a 0-arity function

2015-08-21 Thread Matthew Flatt
At Fri, 21 Aug 2015 12:44:08 -0400, Benjamin Greenman wrote: I'd like to change the result of a 0-arity function, but I need help crafting the right magic spell. Here's my attempt -- this even possible? #lang racket/base (struct wrap (vals)) ;; Wrap a list (define (create) '())

Re: [racket-users] specifying extra compiled collection paths with info.rkt?

2015-08-21 Thread Matthew Flatt
It looks like there's not a way currently, although I think it would make sense to add one. For file extensions generally, I think there should be an info.rkt field to add extensions that are recognized by all tools that apply to all collections. That's a larger project, but it's on my near-term

Re: [racket-users] specifying extra compiled collection paths with info.rkt?

2015-08-22 Thread Matthew Flatt
I've pushed changes so that the set of module suffixes is extensible through a `module-suffixes` definition in a collection's info.rkt. Adding a new suffix affects compilation and testing in all collections. (The suffixes .rkt, .scrbl, .ss, and .scm remain hard-wired in the set.) Module suffixes

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Matthew Flatt
The problem is in the clean-up of OS-level locks. A lock is allocated using a combination of malloc() and pthread_mutex_init(), for example. The clean up was usually missing the free() to go along with pthread_mutex_destroy(). That's an especially basic mistake, and it slipped by because

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Matthew Flatt
I'm looking into this. I can confirm that the GC thinks there's no leak, but the OS thinks there is. Thanks for the example and info! At Mon, 17 Aug 2015 16:09:00 +0100, Tim Brown wrote: Sam, I don’t see the leak with (display (current-memory-use)) -- sorry for leaving it in the example,

Re: [racket-users] DrRacket rendering issues OS X

2015-08-18 Thread Matthew Flatt
mac w/ OS X Yosemite w/ the 6.2 release as well (just to make sure I wasn't crazy or causing the issue on my machine).[image: Screen Shot 2015-08-18 at 4.07.23 PM.png] On Wed, Jun 17, 2015 at 7:13 PM Matthew Flatt mfl...@cs.utah.edu wrote: At Wed, 17 Jun 2015 12:35:36 -0700 (PDT), Andrew

Re: [racket-users] Redex typesetting

2015-08-18 Thread Matthew Flatt
At Tue, 18 Aug 2015 17:45:28 +0200, Paul van der Walt wrote: I have a bunch of typing judgements and metafunctions which i would now like to typeset, but the ⟦⟧ characters are not showing up correctly. I assume this is some kind of fonts problem? Mind you, at some point in the past (some

Re: [racket-users] Re: [racket][system] Web server does not sleep when idling in Solaris/OpenIndiana

2015-06-30 Thread Matthew Flatt
Would using select() instead of poll() avoid the problem? You could try a Racket build that uses select() by changing mzconfig.h as generated by `configure` to not define `HAVE_POLL_SYSCALL`. The `configure` script's check for poll() could be disabled easily on Solaris if using poll() is a bad

[racket-users] upcoming v6.2.1

2015-07-29 Thread Matthew Flatt
We're preparing a v6.2.1 release, which will go out before August 10. The v6.2.1 build will be a small set of patches to v6.2, i.e., not derived from the current development branch. The patches are for the HtDP teaching languages. The main patch for v6.2.1 is to add an option to restore the old

Re: [racket-users] Optimizing closures

2015-07-31 Thread Matthew Flatt
Also, which version of Racket are you using? With v6.1.1 and `in-range`, I get cpu time: 745 real time: 744 gc time: 0 cpu time: 205 real time: 205 gc time: 0 cpu time: 782 real time: 782 gc time: 0 cpu time: 205 real time: 206 gc time: 0 but with v6.2 and `in-range`, I get cpu time: 209

Re: [racket-users] Optimizing closures

2015-07-31 Thread Matthew Flatt
I think you want to use `in-range`. On my machine, adding `in-range` makes each loop run 20 times faster --- which means that the original loops are just testing the performance of the generic sequence case of `for`. (Probably we should make `for` recognize and specialize literal integers, and I

Re: [racket-users] keep everything in each in-place install

2015-08-01 Thread Matthew Flatt
Are you seeing conflicts with different installations that have the same version number? Or different snapshot installations? Two settings can help keep installations separate: * Configure packages for installtion scope instead of user scope by default. You can check the current default

Re: [racket-users] Optimizing closures

2015-07-31 Thread Matthew Flatt
At Fri, 31 Jul 2015 15:03:53 +0100, Laurent wrote: I don't really understand why `in-range` makes such a difference. It looks like the kind of sequence iterator is tested at each step, whereas I was expecting it to be tested only at the beginning of the loop, since this sequence iterator kind

Re: [racket-users] Macro that does substitution

2015-07-29 Thread Matthew Flatt
At Wed, 29 Jul 2015 06:28:48 -0700 (PDT), Klaus Ostermann wrote: I'd like to have a macro let-cbn which does this: (let-cbn ((x1 e1) ...) body) is transformed to (let ((x1 (thunk e1)) ...) newbody) where newbody is the result of replacing every occurence of x1... by (x1)... . What

Re: [racket-users] Units and macros

2015-07-29 Thread Matthew Flatt
At Wed, 29 Jul 2015 07:00:54 -0700 (PDT), Klaus Ostermann wrote: Units are not allowed to export macros, presumably because the unit wiring takes place after the macro expansion. I have a unit and would like to define a few macros based on the interface of that unit. Right now I

Re: [racket-users] Re: send-new-place-channel-to-named-dest usage question

2015-08-08 Thread Matthew Flatt
I fixed the minor issue, but I haven't been able to figure out how `send-new-place-channel-to-named-dest` is meant to work, either. (I'll try again to contact Kevin.) At Thu, 6 Aug 2015 11:32:29 +0100, Tim Brown wrote: On 06/08/15 11:29, Tim Brown wrote: (define node (create-place-node

Re: [racket-users] How to break a process created with system

2015-08-09 Thread Matthew Flatt
Does `(current-subprocess-custodian-mode 'kill)` combined with Cmd-k (for kill, instead of break) make the subprocess terminate? If so, you could use `dynamic-wind` or catch `exn:break` exceptions, possibly put the subprocess under its own custodian, and so on. At Sun, 9 Aug 2015 15:17:19 +0200,

Re: [racket-users] Building on Raspberry Pi - parallel build possible?

2015-08-15 Thread Matthew Flatt
At Sat, 15 Aug 2015 06:37:21 -0700 (PDT), Brian Adkins wrote: The Raspberry Pi has a 4 core CPU, so it pains me to see it pegged at only 25% this whole time. Is it possible to build Racket from Unix Source in parallel to get all 4 cores fired up? You can use make install PLT_SETUP_OPTIONS=-j

Re: [racket-users] Is there a custodian finalizer?

2015-08-08 Thread Matthew Flatt
I think that's the only safe way to make a thread keep running outside the custodian that will be killed. If starting a program under another custodian is too much of a hassle, you could access the root custodian via the FFI and create a thread owned by it. See the implementation of

Re: [racket-users] Literate programming and submodules

2015-08-08 Thread Matthew Flatt
The problem here is the same as in https://groups.google.com/d/msg/racket-users/H7vilh3KcD4/pGZif3F3dEkJ I still haven't thought about it enough to fine better solution than putting `require (only-in racket/base #%module-begin))` before the submodule declaration. At Thu, 30 Jul 2015 16:46:34

Re: [racket-users] Communicating between macros *without* mutation, problems with multiple modules?

2015-08-08 Thread Matthew Flatt
, anyway. At Fri, 7 Aug 2015 22:36:32 -0500, Alexander D. Knauth wrote: Oh, thanks! That makes sense. On the off chance that you have an idea, is there a good way of doing this that doesn't require b being able to see c? On Aug 7, 2015, at 10:23 PM, Matthew Flatt mfl...@cs.utah.edu wrote

Re: [racket-users] Search code

2015-08-08 Thread Matthew Flatt
At Sat, 08 Aug 2015 16:19:23 +0100, Paulo Matos wrote: Where can I find the code for : http://docs.racket-lang.org/search/index.html It's in scribblings/main/private in the racket-index package: https://github.com/plt/racket/tree/master/pkgs/racket-index/scribblings/main/private -- You

Re: [racket-users] saving a BMP in racket

2015-07-27 Thread Matthew Flatt
I've updated `racket/draw` to restore support for writing BMP files. At Sun, 26 Jul 2015 11:55:51 -0400, 'John Clements' via Racket Users wrote: On Jul 23, 2015, at 2:47 AM, copycat kangren.c...@gmail.com wrote: Yes, i can and will try with the old imagemagick bindings. On Thursday,

Re: [racket-users] UDP bytes?

2015-07-27 Thread Matthew Flatt
At Sun, 26 Jul 2015 22:42:48 -0700 (PDT), Слава ПолноеИмя wrote: Sorry, list, for dumb unprofessional question, but I'm not even amateur programmer) How can I convert string and floats to bytes, that can be passed to udp-send? Tried real-floating-point-bytes and string-bytes/utf-8 but it

Re: [racket-users] continuing after a user break

2015-07-27 Thread Matthew Flatt
At Mon, 27 Jul 2015 19:32:32 +, John Carmack wrote: Is it possible to continue execution after a ^b user break in DrRacket (not debugging)? It would often be useful to be able to ^b, print some global state, set some flags, and continue running. The `exn:break` exception record includes

Re: [racket-users] Re: get the content of an editor% with formattings.

2015-07-22 Thread Matthew Flatt
At Wed, 22 Jul 2015 18:41:14 +0200, mazert wrote: Le 14/07/2015 18:12, Matthew Flatt a écrit : If you're trying to move the text from one editor to another, then it's probably easiest to use the `copy` and `paste` methods. No, I try to convert it into html format. But first i need to get

Re: [racket-users] must manually delete compiled file for tests/racket/package.rkt ?

2015-07-26 Thread Matthew Flatt
Yes, this is a limitation of `raco pkg` that is on my list to repair. It happens when a file is removed from a linked package, such as the packages in pkgs, and only when the corresponding .zo file is not yet deleted. It's not an actual conflict, because `raco setup` will soon remove the .zo

Re: [racket-users] Macro introduce identifiers in the new expander

2015-07-21 Thread Matthew Flatt
: That fixed the example I gave, but now this fails: (let () (def) (let () (use))) On Mon, Jul 20, 2015 at 2:50 PM Matthew Flatt mfl...@cs.utah.edu wrote: Repair pushed. On Jul 20, 2015, at 11:14 AM, Matthew Flatt mfl...@cs.utah.edu wrote: Thanks for the info. I think

Re: [racket-users] easy question about `free-identifier=?`

2015-07-24 Thread Matthew Flatt
The documentation's intent is to describe about syntax objects that represent an expanded expression. When you write (define stx #'(let ([x 5]) (+ x 6))) then the syntax object `stx` doesn't represent an expansion. Instead, it's a pile symbols and pairs, all with the same lexical context (taken

Re: [racket-users] Prebuilt Android NDK racket?

2015-07-25 Thread Matthew Flatt
At Sat, 25 Jul 2015 19:58:05 +, John Carmack wrote: Anyone got one handy? Lazily attempting to avoid the day of frustration that usually comes from touching anyone else's NDK project... Untested, but possibly useful:

Re: [racket-users] Re: Extending list-box functionality

2015-07-25 Thread Matthew Flatt
At Thu, 23 Jul 2015 19:57:52 -0700 (PDT), copycat wrote: On Thursday, July 23, 2015 at 2:50:37 PM UTC+8, copycat wrote: With a list box, i can select multiple items by holding onto my mouse and dragging. I'll like to add on other features to the list box like being able to drag the rows to

Re: [racket-users] Scribble: referencing struct fields

2015-07-25 Thread Matthew Flatt
At Thu, 23 Jul 2015 15:07:53 -0700, Jordan Johnson wrote: What are the appropriate function and the preferred practice for referring to struct fields in a Scribble document? For example, if I’m writing the defstruct* body text and want to say, “the x field is intended for blah blah blah”,

Re: [racket-users] Re: set a timeout to tcp-connect

2015-07-17 Thread Matthew Flatt
At Fri, 17 Jul 2015 16:58:50 +0200, mazert wrote: Le 17/07/2015 16:16, Matthias Felleisen a écrit : This actually works. But I am not sure why you'd want to do something like that. Ah yes, letrec is what I was looking for :) . The goal was to test a port with a specific timeout (here I

Re: [racket-users] get the content of an editor% with formattings.

2015-07-14 Thread Matthew Flatt
At Mon, 13 Jul 2015 17:58:36 +0200, mazert wrote: I have a text% inside an editor-canvas% object, and I write some text then I apply to it a blue color for example. When i want to get the text with get-text method, i only get the text without formatings. Is there a way to get the text with

Re: [racket-users] 6.2 regression in running tests?

2015-07-16 Thread Matthew Flatt
At Wed, 15 Jul 2015 22:48:26 -0300, Gustavo Massaccesi wrote: But perhaps the problem is in the code that tracks the single_use value. After 'dup' is applied, 'rep' is not long a singled used function. Yes, I think that's the problem. I thunk I have a repair to update single-use tracking

Re: [racket-users] Problem when using horizontal pane

2015-07-17 Thread Matthew Flatt
At Fri, 17 Jul 2015 15:16:34 +0800, Mianlai Zhou wrote: I have the following code: #lang racket (require slideshow racket/class racket/gui/base) (define my-frame (new frame% [label My chess] [width 300] [height 391]

Re: [racket-users] Current snapshot: problem with generic interfaces and contracts

2015-07-20 Thread Matthew Flatt
That was a bug in the revised implementation of `define-generics` for the new expander. I've pushed a repair. At Sun, 19 Jul 2015 22:34:36 -0400, Alexander D. Knauth wrote: This is a simplified example of something that worked in racket version 6.2.0.4 from 2015-06-08, but is now broken in

Re: [racket-users] Macro introduce identifiers in the new expander

2015-07-20 Thread Matthew Flatt
Repair pushed. On Jul 20, 2015, at 11:14 AM, Matthew Flatt mfl...@cs.utah.edu wrote: Thanks for the info. I think it's a bug in the expander, and I have a repair, but I think that repair might point to another bug that I'm still investigating. At Mon, 20 Jul 2015 12:56:49 -0400

Re: [racket-users] Macro introduce identifiers in the new expander

2015-07-20 Thread Matthew Flatt
Thanks for the info. I think it's a bug in the expander, and I have a repair, but I think that repair might point to another bug that I'm still investigating. At Mon, 20 Jul 2015 12:56:49 -0400, Alexander D. Knauth wrote: I don't really know what's going on, but this might help: ;; It seems

Re: [racket-users] package-build status for upcoming release

2015-10-23 Thread Matthew Flatt
At Fri, 23 Oct 2015 08:47:36 -0600, Matthew Flatt wrote: > At Fri, 23 Oct 2015 08:07:09 -0600, Matthew Flatt wrote: > > Here's an updated build with the current release candidate: > > > > > > http://release-pkg-build.racket-lang.org.s3-website-us-west-2.amazonaws.co

Re: [racket-users] Strange garbage collection behavior with closures

2015-10-22 Thread Matthew Flatt
tained permanently.” But > worse than that, the cycle can be through a second mapping: > > > (define ht (make-weak-hasheq)) > > (let ([a (gensym)] > >       [b (gensym)]) > >   (hash-set! ht a b) > >   (hash-set! ht b a)) > > (collect-garbage) > > (hash-count

Re: [racket-users] R7RS (small) in Racket

2015-10-26 Thread Matthew Flatt
I think a per-version switch would be reasonable. Another approach is to register a different checksum of the package for v6.2.1 and earlier releases, or create a shim for `make-syntax-introducer` that resides in its own package that has different implementations for different releases. To me,

Re: [racket-users] Why doesn't syntax/module-reader work with extra-argument read procedures?

2015-10-26 Thread Matthew Flatt
I don't think there's any reason for the omission aside from it not being implemented. A patch to add that support to `syntax/module-reader` would be welcome. At Sun, 25 Oct 2015 01:07:22 -0700, Alexis King wrote: > When discussing custom `read` and `read-syntax` implementations, the Racket >

Re: [racket-users] syntax-original? always returns #f within syntax transformers?

2015-10-27 Thread Matthew Flatt
This role of marks has been taken over by macro-introduction scopes, so that's still the explanation. A macro-introduction scope is added to the right places by first adding it everywhere to the argument to a macro transformer, then flipping it everywhere in the transformer's result. (The

  1   2   3   4   5   6   7   8   9   10   >