Re: [racket] distributed place messages: write isn't atomic

2015-03-20 Thread Matthew Flatt
At Fri, 20 Mar 2015 10:14:12 +, Tim Brown wrote: I have written a remote-server (as in racket/place/define-remote-server), which I am then trying to use from a web-server. The remote-server is running on a remote node (which is, in fact, localhost). [...] It seems that the RPC packets

Re: [racket] just a question of curiosity about thread

2015-03-20 Thread Matthew Flatt
At Fri, 20 Mar 2015 12:14:14 +0100, Yvan Godin wrote: so questions are: Why aren't *Thread* distributed on a pool of *Place* like Erlang do for it's own *Process* (for scalability) ? Is there a technical reason for that ? Is it difficult to do ? Are the Thread Mailboxes able to

Re: [racket] Submodule tests vs separate-file tests

2015-03-17 Thread Matthew Flatt
Using a submodule does increase the .zo file size, but the submodule portion of the .zo file is not loaded when the main module is loaded, so it's as good as a separate bytecode file. At Tue, 17 Mar 2015 01:38:25 -0700, Alexis King wrote: Is there any preferred convention for location of tests

Re: [racket] Portability of .zo files

2015-03-14 Thread Matthew Flatt
At Sat, 14 Mar 2015 16:20:09 -0300, Gustavo Massaccesi wrote: Can I move a .zo file from a machine that has extflonum enabled to a machine that has extflonum disabled? Yes. Can I move a .zo file from a machine that has extflonum disabled to a machine that has extflonum enabled? Yes. More

Re: [racket] scribble and .gitignore

2015-03-14 Thread Matthew Flatt
Ignoring compiled is right, but documentation goes to doc. The compiled and doc directories should cover all files that are generated by Racket tools. At Sun, 15 Mar 2015 02:33:10 +0800, WarGrey Gyoudmon Ju wrote: I use ./compiled as the dest directory so that all generated files can be omitted

Re: [racket] scribble and .gitignore

2015-03-14 Thread Matthew Flatt
At Sat, 14 Mar 2015 13:30:26 -0400, Jon Zeppieri wrote: I've been looking at the .gitignore files in various racket packages, and the ones I've seen don't ignore files generated by scribble (.html .css, etc.). So what is the common practice for keeping those files out of source control? All

Re: [racket] runiing racket 6.1.1 under valgrind

2015-03-13 Thread Matthew Flatt
At Mon, 2 Mar 2015 09:25:40 +0300, Sergey Pinaev wrote: On Fri, 27 Feb 2015 08:00:34 -0700 Matthew Flatt mfl...@cs.utah.edu wrote: That's as far as I've ever gotten with memcheck. Racket manipulates the C stack in ways that are far outside of what is supposed to be allowed, and I think

Re: [racket] how to get line numbers on syntax errors on load?

2015-03-13 Thread Matthew Flatt
Sometimes, source locations are missing because the relevant expression or definition was macro-introduced. Syntax in macro templates currently does not preserve its source location when compiled to .zo format. That choice was intended to keep bytecode files smaller, but I expect we'll revisit it

Re: [racket] Unexpected results with impersonators and make-keyword-procedure

2015-03-09 Thread Matthew Flatt
:12 PM, Matthew Flatt mfl...@cs.utah.edu wrote: I agree that this is a bug --- specific to impersonators that are not chaperones --- and I've pushed a repair to the Git repo. The general repair was to make impersonator-property predicates and accessors sensitive to `prop:impersonator

Re: [racket] Unexpected results with impersonators and make-keyword-procedure

2015-03-08 Thread Matthew Flatt
I agree that this is a bug --- specific to impersonators that are not chaperones --- and I've pushed a repair to the Git repo. The general repair was to make impersonator-property predicates and accessors sensitive to `prop:impersonator-of`. When a structure impersoator does not have a particular

Re: [racket] is there a way to shift all installed packages to installation scope?

2015-03-06 Thread Matthew Flatt
At Fri, 6 Mar 2015 13:07:35 -0500, Alexander D. Knauth wrote: Is there a way to shift all installed packages to installation scope? There is not currently a short way to do that. (The `raco pkg migrate` tool almost works, but it cannot read and write the same installation.) You could use

Re: [racket] windows-1252 charset decoding

2015-03-03 Thread Matthew Flatt
You can use windows-1252 as an encoding name with, for example, `reencode-input-port`: (read-line (reencode-input-port (open-input-bytes #\xA3) windows-1252)) £ For handling e-mail, see also `generalize-encoding` from `net/unihead`. At Tue, 3 Mar 2015

Re: [racket] DrRacket 6.1.1 stuck in a gc loop on Windows7x64

2015-02-28 Thread Matthew Flatt
Based on your description and the stack trace, I think this is probably a bug that I fixed in November (after the v6.1.1 release): https://github.com/plt/racket/commit/50a8863169 Thanks for the report! At Tue, 24 Feb 2015 23:06:22 -0500, Ben Lerner wrote: I ran into an unfortunate situation

Re: [racket] runiing racket 6.1.1 under valgrind

2015-02-27 Thread Matthew Flatt
That's as far as I've ever gotten with memcheck. Racket manipulates the C stack in ways that are far outside of what is supposed to be allowed, and I think it confuses Valgrind. I don't know if there's a way to tell Valgrind to allow this behavior and/or to give up on checking operations related

Re: [racket] raco exe: unknown module

2015-02-27 Thread Matthew Flatt
We've pushed repairs for the problem. It started with a recent change in TR to avoid loading contracts when typed code isn't used in untyped contracts, refining that implementation exposed a problem with `raco exe`, etc. Thanks for the report! At Fri, 27 Feb 2015 15:39:14 +0300, Dmitry Pavlov

Re: [racket] compiling Racket to android and ios apps

2015-02-24 Thread Matthew Flatt
At Tue, 24 Feb 2015 13:54:46 -0500, Eric Dong wrote: I would actually think that a good first step would be to port the Racket VM The Racket VM runs on Android. See racket/src/README for hints on building (but it's just cross-compilation as usual), and let us know if you run into trouble.

Re: [racket] Options for debugging

2015-02-23 Thread Matthew Flatt
The equivalent of Debugging is racket -l errortrace -t example.rkt but you'll have to manually ensure that no .zo is present for any file that you want instrumented for Errortrace. At Mon, 23 Feb 2015 18:16:09 -0300, Gustavo Massaccesi wrote: I want to debug a file example.rkt. I want to run

Re: [racket] compiling Racket to android and ios apps

2015-02-22 Thread Matthew Flatt
[Jens and I have traded a few more messages...] My guess is that /usr/bin/gcc isn't compatible with the SDK in /Applications/XCode.app. Jens will adjust his path to use a more recent gcc already installed on his machine, which I think matches the current XCode release and probably his

Re: [racket] Smaller verbatim in Scribble PDF?

2015-02-21 Thread Matthew Flatt
For PDF output, you can use the string smaller instead of the symbol 'smaller: (nested #:style smaller ...) That works because smaller happens to be available as an environment in Latex. (If smaller didn't happen to be available already, you could define a Latex environment in much the same

Re: [racket] Debugging html library

2015-02-17 Thread Matthew Flatt
At Tue, 17 Feb 2015 14:06:49 -0800, John Clements wrote: I think that you want to use raco pkg install --clone html Well, `raco pkg update` instead of `raco pkg install`, since that the html package is already installed. Also, that will only work with a pre-release version of Racket, since

Re: [racket] Racket macro state reset

2015-02-16 Thread Matthew Flatt
At Mon, 16 Feb 2015 14:36:16 -0500, Paul Ojanen wrote: I'm working on a macro that will have mutable state. [I'm new to macros in general, and I'm new to pattern matching in Racket and all things related to syntax functions and objects. I'm also still learning about macro expansion,

Re: [racket] handin-server and image? conflict with 2htdp/image and lang/htdp-beginner

2015-02-12 Thread Matthew Flatt
One solution is to create a module that exports only the things you want, so that you can provide a module path that effectively implements a more general `require` spec. Then, to avoid path problems, it will be easiest to install that module as a package. Specifically, create a directory and

Re: [racket] ARGH my packages are broken and I'm stuck

2015-02-10 Thread Matthew Flatt
At Tue, 10 Feb 2015 18:19:40 -0800, Ryan Davis wrote: 10045 % raco pkg install cover/ raco setup: given collection path: cover refers to the same directory as another given collection path, zenspider/cover I think you have the enclosing directory zenspider installed as a package. Does `raco

Re: [racket] prop:procedure and arity

2015-02-09 Thread Matthew Flatt
At Mon, 9 Feb 2015 19:36:56 -0500, Alexander D. Knauth wrote: Say I want a struct that will act as a procedure. For a given instance of that struct, I want the procedure to have a given arity, but I don’t want the procedure to be a field in the struct. Is there a way to do this without making

Re: [racket] ill-formed code (unexpected graph structure) with custom #lang

2015-02-09 Thread Matthew Flatt
It looks like the module has associated language info that contains a hash table, and the bytecode reader doesn't handle the hash table properly in that context. You can work around the problem by choosing a different representation of language info for slon. At Sun, 08 Feb 2015 00:56:20 +0300,

Re: [racket] FFI structs and custom offsets

2015-02-09 Thread Matthew Flatt
I think the value of `_list-struct` is mostly that computes offsets for you based on the current platform's conventions. If you know the offsets that you want to use, then you could make A C-type constructor from scratch using `make-ctype` --- with `malloc` and `ptr-set!` in the Racket-to-C

Re: [racket] Is the pkg-build service down?

2015-02-06 Thread Matthew Flatt
At Fri, 6 Feb 2015 10:47:07 -0800, Alexis King wrote: Packages don’t appear to have been building on pkg-build for the past two days. Any reason for that? Yes, the machine is either down off the network. I don't know why, yet, but I'll be back when I can fix it tomorrow. (Our

Re: [racket] Problem with structs and #lang racket/signature

2015-02-05 Thread Matthew Flatt
Yes, it appears that `racket/signature` exports a `struct` that is consistent with `define-struct` instead of `struct`. I'm not sure whether that was a bug that didn't get caught, or whether it was intentional (for some kind of compatibility) and was documented incorrectly. My guess is that it

Re: [racket] Package conflicts for docs with the same names in different collections?

2015-02-04 Thread Matthew Flatt
All document names need to be unique. When the corresponding packages are installed in installation scope, the documentation for all packages goes to the same place (in the doc subdirectory of the installation). At Wed, 4 Feb 2015 11:28:33 -0800, Alexis King wrote: I was looking at the package

Re: [racket] Units and serializable-struct

2015-02-04 Thread Matthew Flatt
The `struct` form in a signature describes a structure type that will be implemented by some unit. It can't work to have a similar `serializable-struct` form in a signature, because different units can implement a signature with different structure types, and a deserializer can't know which one to

Re: [racket] Retrieving OS file handle from file ports

2015-02-01 Thread Matthew Flatt
The Racket C API provides intptr_t scheme_get_port_fd(Scheme_Object* port); which you can access through the FFI: (require ffi/unsafe) (define scheme_get_port_fd (get-ffi-obj 'scheme_get_port_fd #f (_fun _racket - _intptr))) (scheme_get_port_fd (current-output-port)) At Sun, 1 Feb

Re: [racket] forward pointer declarations

2015-02-01 Thread Matthew Flatt
At Sun, 01 Feb 2015 19:08:08 -0500, Anthony Carrico wrote: On 02/01/2015 05:57 PM, Anthony Carrico wrote: I get a duplicate definition error if I declare a pointer ahead: (define _wl_interface-pointer (_cpointer 'wl_interface)) This isn't perfectly satisfying, but one option is to use a

Re: [racket] package dependancies, version exceptions, version dependancies, and pkg-build

2015-01-31 Thread Matthew Flatt
No, the version exception appears to be working fine, but it looks like there's a bug in the way that pkg-build decides which packages to retry. I see that the current pkg-build results for typed-big-bang are from yesterday, and the v6.1.1-specific mapping for 2htdp-typed was added later. The

Re: [racket] Encoding problem when using smtp-send-message send email to evernote

2015-01-29 Thread Matthew Flatt
The `smtp-send-message` and `standard-header` functions do not attempt any encoding --- which means that it ends up encoding in UTF-8, while the receiving end probably interprets it as Latin-1. There's a `net/unihead` library that provides an `encode-for-header` function that's suitable for

Re: [racket] Drawing in the Canvas from outside

2015-01-28 Thread Matthew Flatt
For the record, here's an example of that technique. At Tue, 27 Jan 2015 11:23:29 -0700, Matthew Flatt wrote: You can draw on the canvas from the outside using `get-dc`. Possibly, though, you're seeing your drawing erased when the canvas receives a refresh event from the window system. See

Re: [racket] Problems using Sandbox and Scribble

2015-01-28 Thread Matthew Flatt
, Matthew Flatt mfl...@cs.utah.edu wrote: The `#:requires` option of `make-evaluator` requires the named modules in the sandbox's namespace, but the module instances are distinct from any instances in the original namespace. To attach the original namespace's instances to the sandbox's

Re: [racket] Drawing in the Canvas from outside

2015-01-27 Thread Matthew Flatt
You can draw on the canvas from the outside using `get-dc`. Possibly, though, you're seeing your drawing erased when the canvas receives a refresh event from the window system. See http://docs.racket-lang.org/gui/canvas___.html for more about `on-paint` and the impermanence of drawing from the

Re: [racket] Problems using Sandbox and Scribble

2015-01-27 Thread Matthew Flatt
The `#:requires` option of `make-evaluator` requires the named modules in the sandbox's namespace, but the module instances are distinct from any instances in the original namespace. To attach the original namespace's instances to the sandbox's namespace, use the `sandbox-namespace-specs`

Re: [racket] machine states diagrams

2015-01-25 Thread Matthew Flatt
At Sun, 25 Jan 2015 23:37:12 +0100, Jens Axel Søgaard wrote: 2015-01-25 23:25 GMT+01:00 Catonano caton...@gmail.com: 2015-01-25 23:18 GMT+01:00 Jens Axel Søgaard jensa...@soegaard.net: 2015-01-25 23:09 GMT+01:00 Catonano caton...@gmail.com: How do I install metapict ? I tried

Re: [racket] Untyped arithmetics performance

2015-01-24 Thread Matthew Flatt
At Sat, 24 Jan 2015 18:14:39 +0100, Daniel Kvasnička wrote: What about the segmentation fault? Am I doing something wrong? You're missing an conversion from fixnum to flonum in the second argument to `unsafe-fl/`: (time (exact-inexact (for/sum ([x (in-range 1)]) (unsafe-fl/ (-fl x)

Re: [racket] Untyped arithmetics performance

2015-01-24 Thread Matthew Flatt
At Sat, 24 Jan 2015 19:14:18 +0100, Daniel Kvasnička wrote: What about the segmentation fault? Am I doing something wrong? You're missing an conversion from fixnum to flonum in the second argument to `unsafe-fl/`: At first I thought the same but (unsafe-fl/ 3.0 4) works and (flonum?

Re: [racket] Untyped arithmetics performance

2015-01-24 Thread Matthew Flatt
Jens Axel and Alexander have provided the answer, but in case it helps to see what they mean, try these loops that display the intermediate results: (for/fold ([v 0]) ([x (in-range 100)]) (displayln v) (+ v (/ x 100))) (for/fold ([v 0]) ([x (in-range 100)]) (displayln v) (+ v (/ x

Re: [racket] Scribble index missing when generating pdf file

2015-01-24 Thread Matthew Flatt
It looks like index output for the Latex/PDF back end has been broken for a while. I'll fix it. At Sat, 24 Jan 2015 17:38:54 +0100, Jens Axel Søgaard wrote: Hi All. The following document when rendered to HTML gives a nice index. However when rendered to PDF the index page just has the Index

Re: [racket] Scribble and itemlists

2015-01-22 Thread Matthew Flatt
Is rendered in HTML simply as olliX/liliY/liliZ/li/ol. As for HTML, I think this is supported only starting with HTML 5. You can say ol start=3.../ol. Keep in mind that HTML 5 means specifying !doctype html. But I don't think Scribble does, now? On Wed, Jan 21, 2015 at 9:18 AM, Matthew Flatt mfl

Re: [racket] Macros in slideshow

2015-01-21 Thread Matthew Flatt
At Wed, 21 Jan 2015 13:04:11 +, Reuben Thomas wrote: Since I have a lot of slides like this, I want to write a macro. I tried: #lang slideshow ​(require slideshow/step) (define-syntax-rule (correct from to) (lt-superimpose ((vonly before) (t from)) ((vonly after) (t to

Re: [racket] Windows FFI Problem

2015-01-16 Thread Matthew Flatt
, 15 Jan 2015 18:55:41 -0700, Matthew Flatt wrote: At Thu, 15 Jan 2015 22:10:35 + (UTC), Lehi Toskin wrote: I am attempting to use this C library I've written with the Racket FFI, but (ffi-lib mylib) reports The specified module could not be found.; errno=126. This only happens

Re: [racket] racket runs very slowly

2015-01-16 Thread Matthew Flatt
It sounds like a bytecode file location/timestamp problem. Does racket -l mzlib/traceld -l racket show loading the expected .zo files, or loading .rkt sources? At Thu, 15 Jan 2015 20:39:15 -0500, Carl Eastlund wrote: I just updated my Racket clone and rebuilt it for the first time in quite a

Re: [racket] Bug in srfi-42

2015-01-16 Thread Matthew Flatt
Thanks for the report, and thanks to Jens Axel for providing a repair for the next version. At Fri, 9 Jan 2015 15:53:18 -0800, William James wrote: Racket bug: Welcome to Racket v6.1.1. (require srfi/42) (list-ec (: n 2 8) (if (odd? n)) n) '(3 5 7) (first-ec #f (: n 2 8) (if (odd? n))

Re: [racket] Windows FFI Problem

2015-01-15 Thread Matthew Flatt
At Thu, 15 Jan 2015 22:10:35 + (UTC), Lehi Toskin wrote: I am attempting to use this C library I've written with the Racket FFI, but (ffi-lib mylib) reports The specified module could not be found.; errno=126. This only happens on Windows. On Linux the library gets loaded properly and I

Re: [racket] sandbox error

2015-01-14 Thread Matthew Flatt
/racket '(#path:/home/lucas/.racket/6.1.1/lib #path:/usr/lib/racket #path:/usr/lib) On Wed, Jan 14, 2015 at 12:17 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Trying /usr/lib/libcrypto with no suffix is a last-ditch effort. It accommodates a library request where the given library name has

Re: [racket] sandbox error

2015-01-14 Thread Matthew Flatt
, Matthew Flatt mfl...@cs.utah.edu wrote: I think `scribble/manual` is trying to load libcrypto as part of using OpenSSL for its SHA1 functionality. I haven't been able to replicate the error that you're getting, and my best guess is that we need to add a version of libcrypto to our list

Re: [racket] sandbox error

2015-01-14 Thread Matthew Flatt
I think `scribble/manual` is trying to load libcrypto as part of using OpenSSL for its SHA1 functionality. I haven't been able to replicate the error that you're getting, and my best guess is that we need to add a version of libcrypto to our list. Does your installation have any of these?

Re: [racket] Package server connection flaky?

2015-01-13 Thread Matthew Flatt
The catalog content of pkgs.racket-lang.org (as opposed to the server that handles dynamic functionality for the web interface) is served directly from S3, so it should be reliable. You're showing a host not found error. I think that would be a DNS failure, not a server failure. A DNS failure

Re: [racket] The Racket package management model

2015-01-10 Thread Matthew Flatt
The error reporting should be better, but the problem is that snapshot catalogs are discarded after a week or so. So, a Utah snapshot that's from January 4 or later will work, while older snapshots will fail to find the associated snapshot-specific catalog. As an alternative to installing a new

Re: [racket] Writing checkers for handin-server

2015-01-07 Thread Matthew Flatt
I do use the web server. I have always used a subdirectiry named solution within the assignment directory. Is the relevant assignment directory in the `inactive-dirs` list? At Wed, 7 Jan 2015 21:45:20 -0500, Suzanne Menzel wrote: Do you use the embedded web server? If so, could you explain how

Re: [racket] Void expression found

2015-01-07 Thread Matthew Flatt
At Tue, 6 Jan 2015 19:05:24 -0500, Benjamin Greenman wrote: From a practical point of view, at the low level the implementation is heavily optimized for functions that return exactly one value. Functions that return a different number of values are slower. Does this mean I'm better

Re: [racket] Writing checkers for handin-server

2015-01-07 Thread Matthew Flatt
At Tue, 6 Jan 2015 16:33:04 -0500, Suzanne Menzel wrote: I’m trying to set up the handin-server to use in my class this semester and I’ve run into a few problems that I hope someone can help with. I’ve got the server up and running and the Handin button appears in DrRacket. I currently

Re: [racket] Understanding local-expand with definition contexts

2015-01-07 Thread Matthew Flatt
At Mon, 5 Jan 2015 18:53:57 -0500, Ryan Culpepper wrote: Here’s an alternative solution as a trampolining* macro. Thanks! That's definitely a better and more general approach. The key is to cooperates with the unit macro’s definition-context handling rather than trying to duplicate that

Re: [racket] why a segfault on the command line, but not in DrRacket?

2015-01-06 Thread Matthew Flatt
Thanks for sorting out that I need to run without .zo files to provoke the crash! Your program exposed two different bugs in the JIT, both with the same symptom --- overflowing an internal stack --- and both in the surprising that we didn't hit these before category. The first bug was in a slow

Re: [racket] Documentation not building on the pkg.racket-lang.org

2015-01-06 Thread Matthew Flatt
A power failure took the pkg-build service down a week ago, and I didn't notice. I've turned the machine back on. (Yep, it's time to put better monitoring in place.) At Wed, 07 Jan 2015 03:18:22 +, Spencer Florence wrote: Hey Y'all, I'm trying to get the documentation for one of my

Re: [racket] Understanding local-expand with definition contexts

2015-01-05 Thread Matthew Flatt
The error message is intended for end users and turns out to be misleading for the implementor of an internal-definition context. The documentation for `define-values` has essentially the same problem: it describes how `define-values` should work in an internal-definition context, but it doesn't

Re: [racket] Understanding local-expand with definition contexts

2015-01-05 Thread Matthew Flatt
, but I'm not sure how to get a hold of that. --spf On Mon Jan 05 2015 at 10:00:53 AM Matthew Flatt mfl...@cs.utah.edu wrote: The error message is intended for end users and turns out to be misleading for the implementor of an internal-definition context. The documentation for `define

Re: [racket] Understanding local-expand with definition contexts

2015-01-05 Thread Matthew Flatt
(local-expand/capture-lifts stx something)]) #'(unit (imports ...) (exports ...) body))])) Where the defines in #'(e ...) are visible to `unit` so that they can be used for exports. --spf On Mon Jan 05 2015 at 11:32:46 AM Matthew Flatt mfl...@cs.utah.edu wrote: I think it's more

Re: [racket] Understanding local-expand with definition contexts

2015-01-05 Thread Matthew Flatt
2015 at 12:10:53 PM Matthew Flatt mfl...@cs.utah.edu wrote: I'm not really clear on what you're trying to do. One way to explain more might be to explain how `test` is meant to differ from `begin`. Or maybe you can say why it doesn't work to add the internal-definition context to the bindings

Re: [racket] Performance help

2015-01-04 Thread Matthew Flatt
At Sun, 4 Jan 2015 20:18:11 +0100, Jens Axel Søgaard wrote: One possibility: Python hash tables are fast(er). That reminds me: I sped up `equal?` hash tables on strings in v6.1.1. If Jyotirmoy is using version v6.1 instead of v6.1.1, that could explain the time differences that he sees versus

Re: [racket] easiest way to build from updated source with all packages?

2015-01-02 Thread Matthew Flatt
At Fri, 02 Jan 2015 14:17:02 -0500, Tony Garnock-Jones wrote: On 01/02/2015 02:05 PM, Robby Findler wrote: I usually do something like that git pull, then 'make base' and then 'raco pkg update --all --auto' and then 'raco setup'. IIUC, these are in flux, however, so maybe there will be a

Re: [racket] FFI: Create reference to Objective C object

2015-01-02 Thread Matthew Flatt
In this example, `kTISPropertyUnicodeKeyLayoutData` is already a `CFStringRef` (a.k.a. `NSString*`). The type `_NSString` from `mred/private/wx/cocoa/types` (or, better for most purposes, from `ffi/unsafe/nsstring`) is really a pointer to an `_NSString`; it just gets tedious to put `Ref` or

Re: [racket] why a segfault on the command line, but not in DrRacket?

2014-12-30 Thread Matthew Flatt
Does your program use any foreign libraries? That behavior sounds typical of memory-management problems. On Dec 30, 2014, at 11:47 AM, Matthew Butterick m...@mbtype.com wrote: I have a program that consistently works in DrRacket regardless of input size. But on the command line, once

Re: [racket] why a segfault on the command line, but not in DrRacket?

2014-12-30 Thread Matthew Flatt
, and it ran fine. When I tried running on the command line with this input, I got a different error than before (and within a couple seconds of starting the program): Seg fault (internal error during gc) at 0x10aac Bus error: 10 (core dumped) On Tue, Dec 30, 2014 at 11:09 AM, Matthew

Re: [racket] Cannot reproduce example in Getting Started with Documentation

2014-12-29 Thread Matthew Flatt
At Mon, 29 Dec 2014 22:56:36 +, Stuart McLuckie wrote: I can't to reproduce the Scribble example in section 4.1.4 of Getting Started with Documentation. The procedure 'my-helper' is undefined in the html output: Examples: (my-helper'()) my-helper: undefined; cannot

Re: [racket] SIgnal-catching in Racket

2014-12-21 Thread Matthew Flatt
You're right that can't post to a Racket semaphore in a signal handler. The way to allocate a global and make it available to Racket code is to create a new kind of event; the 2006 post is still accurate. In particular, the new event's polling function (which is called by the scheduler) can check

Re: [racket] Memory buildup (leak?) when using `copy-port` with SSL connections.

2014-12-18 Thread Matthew Flatt
Is the program reaching the calls to `close-output-port` and `close-input-port`? The output port created by `ssl-connect` doesn't send a shutdown message to the other end of the SSL connection when the port is closed, because that shutdown action tends to produce errors that have to be caught.

Re: [racket] raco command extension changed in 6.1?

2014-12-18 Thread Matthew Flatt
I've pushed a repair for the next version. Unfortunately, I don't see a better workaround in the current version than running `raco setup`. At Wed, 17 Dec 2014 20:18:00 -0700, Matthew Flatt wrote: It wasn't supposed to change, but apparently something has broken between 6.0.1 and 6.1

Re: [racket] using scribble/eval in conjunction with scribble/lp

2014-12-17 Thread Matthew Flatt
. This is the reason I think Racket is so great. You were able to create the lp language version 2 as an afterthought. Awesome. On Tue, Dec 16, 2014 at 3:04 PM, Matthew Flatt mfl...@cs.utah.edu wrote: ... after the next build, at least. Problems related to the repository split have prevented

Re: [racket] raco command extension changed in 6.1?

2014-12-17 Thread Matthew Flatt
It wasn't supposed to change, but apparently something has broken between 6.0.1 and 6.1. Running `raco setup` afterward adds `raco mcfly`, but the `require` should have been enough, and I'll investigate further. At Wed, 17 Dec 2014 21:52:41 -0500, Neil Van Dyke wrote: Did how `raco` commands

Re: [racket] documentation format for racket packages

2014-12-17 Thread Matthew Flatt
At Wed, 17 Dec 2014 22:00:36 -0500, Neil Van Dyke wrote: Two questions, for the documentation of a single-collection package in `.zip` format (in the new package system)... * Given that the package is named `mypackage`, must the Scribble file be named `mypackage.scrbl`, or will things work

Re: [racket] using scribble/eval in conjunction with scribble/lp

2014-12-16 Thread Matthew Flatt
Date: Tue, Dec 16, 2014 at 1:27 PM Subject: Re: [racket] using scribble/eval in conjunction with scribble/lp To: Matthew Flatt mfl...@cs.utah.edu Hmm, I'm having trouble finding this new release of Racket that will allow a #lang scribble/lp2 -- I'll keep looking later. This is awesome

Re: [racket] using scribble/eval in conjunction with scribble/lp

2014-12-15 Thread Matthew Flatt
The `examples` form uses a fresh namespace for its evaluation. As part of lp.rkt, you could set up an evaluator that is initialized to use the enclosing module's namespace. ;; lp.rkt: #lang scribble/lp @(require scribble/eval) This would be a wonderful

Re: [racket] using scribble/eval in conjunction with scribble/lp

2014-12-15 Thread Matthew Flatt
At Mon, 15 Dec 2014 15:49:38 -0700, Matthew Flatt wrote: Meanwhile, I'll work on changing `scribble/lp` so that a module implemented with `#lang scribble/lp` can be passed directly to Scribble. That turned out to be `scribble/lp2`, since the changes would be incompatible with existing uses

Re: [racket] avoiding unnecessary work when using `log-debug` et al

2014-12-12 Thread Matthew Flatt
By default, Racket starts receivers at 'error to direct logged errors to stderr and syslog. Running your program with racket -W none -L none avoids the call to `expensive`. At Fri, 12 Dec 2014 14:27:24 -0800, Matthew Butterick wrote: I see that you're right about `log-debug`, but here's

Re: [racket] Run-time record access

2014-12-10 Thread Matthew Flatt
Currently, the run-time representation of a struct doesn't include field names. In that sense, field names don't exist at run time, and all fields are accessed by position. We plan to change the structure-type core to add field names, but it hasn't happened, yet. At Wed, 10 Dec 2014 04:36:50

Re: [racket] Continuation in embedding Racket

2014-12-05 Thread Matthew Flatt
At Thu, 04 Dec 2014 00:23:37 +0300, Nesterov Kirill wrote: (call-with-continuation-prompt (lambda () (generate-digit))) With this I'm getting segfault. Sorry for the delay! Looking back at your original explanation: At Wed, 03 Dec 2014 23:45:28 +0300, Nesterov Kirill wrote:  I'm trying

Re: [racket] Fwd: [racket-bug] all/14865: Instances of button% don't not respond to (stretchable-height #t) and [min-height 300].

2014-12-03 Thread Matthew Flatt
I believe the issue is that the underlying Cocoa widget doesn't stretch vertically. Even tough `racket/gui` asks the button to be taller, Cocoa draws the button the at the original height. There's an alternative button style that does stretch, and `racket/gui` falls back to that alternative style

Re: [racket] Continuation in embedding Racket

2014-12-03 Thread Matthew Flatt
I don't think CGC versus 3m is relevant. My guess is that you need to wrap a prompt around each evaluation of a top-level form. You can try this manually at first: Does it work to change each `(generate-digit)` at the end below to (call-with-continuation-prompt (lambda () (generate-digit))) ?

Re: [racket] how to get exact results from get-text-extent

2014-12-01 Thread Matthew Flatt
We should probably improve the contracts on `racket/draw` to promise flonum results for text metrics. The intent is to make metric-derived calculations have a predictable cost, instead of potentially triggering expensive exact arithmetic. When you say that Pango produces exact results, do you

Re: [racket] Syntax objects in prefab structures

2014-11-28 Thread Matthew Flatt
Prefab structures are tested like pairs, vectors, and boxes in syntax objects. For example, `datum-syntax` and `syntax-datum` can recur into a prefab, but they don't go into transparent structures. If you add a list to your list of two structures, (set! structs (list (list #'foox) (foo #'foox)

Re: [racket] Extending DrRacket with non-text tabs

2014-11-28 Thread Matthew Flatt
The package-build service does not currently support access to PLaneT packages. You can find more information about the package-build service here: http://pkg-build.racket-lang.org/about.html (That page was intended to be linked from the main packages page, but we haven't gotten there, yet.)

Re: [racket] Extending DrRacket with non-text tabs

2014-11-28 Thread Matthew Flatt
the developer of table-panel to transfer it to pkgs.racket-lang.org (so that spradsheet-editor could access it), or to wait until pkgs.racket-lang.org supports PLaneT packages? Best regards, Dmitry On 11/28/2014 07:22 PM, Matthew Flatt wrote: The package-build service does not currently

Re: [racket] language-info in #lang typed/racket files vs. (module _ typed/racket ...) files

2014-11-25 Thread Matthew Flatt
I'll adjust the docs to clarify that language info was a failed idea that has been subsumed by submodules. At Mon, 24 Nov 2014 17:32:12 -0500, Vincent St-Amour wrote: The contract profiler has to solve a similar problem, to distinguish typed and untyped modules in its module view. ISTR

Re: [racket] 18 scribble-created files

2014-11-24 Thread Matthew Flatt
Ah, I misread the your original question as can an installed package have fewer files?. For rendering a document independent of a package installation, I think we're pretty close to a good answer with #lang racket (require scribble/render (prefix-in html: scribble/html-render)

Re: [racket] 18 scribble-created files

2014-11-23 Thread Matthew Flatt
No, there's not already a way in place. Is it a question of file count or file sizes? There are many goals and constraints that go into that layout, so removing any individual file is difficult. I think the size could be reduced a lot, though. For example, the manual-fonts.css file doesn't

Re: [racket] scribble/base doesn't use new css?

2014-11-23 Thread Matthew Flatt
Are you looking for `manual-doc-style` to add to your document's main part? Or do you need more information about applying a style from the outside of a document whose source you can't modify? At Sun, 23 Nov 2014 16:43:48 -0500, Stephen Chang wrote: If my scribble file begins with #lang

Re: [racket] What encoding does racket/drracket use for bytestring literals?

2014-11-13 Thread Matthew Flatt
Yes, that's strange behavior. Just to be clear, the reader works at the layer of characters, which means that the content of a #... literal is expressed in terms of characters. The intent is that characters in the Unicode range 0-255 represent the corresponding byte value in the byte string ---

Re: [racket] place: terrible performance of place-channel-get?

2014-11-12 Thread Matthew Flatt
-get p1) ; = 'ready (place-channel-put p1 v1) (time (place-channel-get p1))) That way, `v1` doesn't sit in the message channel long enough to cause a problem. At Tue, 11 Nov 2014 17:41:11 -0700, Matthew Flatt wrote: This does seem extremely slow. A place-message send must copy the vector

Re: [racket] place: terrible performance of place-channel-get?

2014-11-11 Thread Matthew Flatt
This does seem extremely slow. A place-message send must copy the vector to send it as a message, but the copy shouldn't take so long. I'll investigate further. Meanwhile, an option in this case might be to created a shared flvector, which can be passed directly (i.e., without copying) to another

Re: [racket] Permission errors with nightlies?

2014-11-04 Thread Matthew Flatt
Yes, it's a problem with yesterday's snapshot from Utah, and the most recent one failed for unrelated reasons. I've kick off a new snapshot, so it should be available in about 3 hours. If you can tolerate errors provoked by bad snapshots, then I think building against the snapshot is a good

Re: [racket] Programmatic drawing

2014-10-30 Thread Matthew Flatt
Yes, the `dc` pict constructor provides a bridge between `racket/draw` and picts: #lang slideshow (slide (dc (lambda (dc x y) (send dc draw-spline x y (+ x 20) (+ y 80) (+ x 100) (+ y 100))) 100 100)) At Thu, 30 Oct 2014 23:46:21

Re: [racket] Promises and parameters

2014-10-30 Thread Matthew Flatt
I can see why you might want or expect '(4) below, and it turns out that changing `delay` to `delay/thread` makes the result '(4) instead of '(5). We could extract that facet of `delay/thread` (without the concurrency) as (define-syntax-rule (delay* e) (let ([params

Re: [racket] macro calling itself

2014-10-27 Thread Matthew Flatt
We sometimes call this the non-hygienic macros compose poorly problem. The two-subform case of `definer` uses the overall form, `stx`, to provide a content for the introduced `arg-id` binding. So, when you use the two-subform variant directly in some context, then you can see the `arg-id` binding

Re: [racket] Deadlock with FIFO files

2014-10-26 Thread Matthew Flatt
It looks like kqueue() is broken for FIFOs on Mac OS X. See the enclosed kqueue_fifo.c. Unless I'm confused (a review of the enclosed program would be welcome), adding a kqueue event to watch for FIFO input disables an event that watches for FIFO output space, or something like that. I enabled

  1   2   3   4   5   6   7   8   9   10   >