Re: [racket-users] Re: hashcons

2020-09-14 Thread Tony Garnock-Jones
On Mon, 14 Sep 2020 at 14:18, Hendrik Boom wrote: > I would, ideally, only use hashcons on those cons-cells which had > themselves > been hashconsed, so eq? would suffice. > The challenge is checking to see whether a new allocation is required. Checking `eq?` of the cdr suffices, but seldom is

Re: [racket-users] Re: hashcons

2020-09-14 Thread Tony Garnock-Jones
On Sunday, September 13, 2020 at 12:41:15 AM UTC+2 hen...@topoi.pooq.com wrote: > True, but that would require rewriting list, and quasiquote, ans > others like that to use the hashcons. > > Not impossible. > One potentially useful trick is to write a function `canonicalize` which deeply

Re: [racket-users] How to change package name on the package index?

2020-06-05 Thread Tony Garnock-Jones
I think the package name system is case-insensitive (??) but case-preserving (definitely), and certainly objects to trying to create two packages that differ only in case. So renaming from FOO to foo won't work, because it considers this an attempt to overwrite an existing package. I think. We

[racket-users] Are there interfaces for IP ports at least raw sockets?

2020-04-09 Thread Tony Garnock-Jones
If you've not already seen and considered it, https://github.com/tonyg/racket-packet-socket might be worth a look. Regards, Tony -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it,

Re: [racket-users] Re: Package server broken, at least five hundred intro cs students affected!

2019-10-06 Thread Tony Garnock-Jones
On Sunday, October 6, 2019 at 3:26:13 PM UTC+1, Bogdan Popa wrote: > > I feel like that was me. Sorry! > It was :-) No apologies please! There was nothing wrong with your packages; it was the package indexer at fault here. One thing I'd like to do is formalise and then check the contracts

[racket-users] Re: Package server broken, at least five hundred intro cs students affected!

2019-10-06 Thread Tony Garnock-Jones
Hi Gary, On Saturday, October 5, 2019 at 11:22:30 PM UTC+1, gfb wrote: > > 1. What's wrong with the package server's indexing of updated packages, so > my students can proceed. > Thanks for the report, and sorry for the delay in responding. I've made a change that ought to resolve the issue

Re: [racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-08 Thread Tony Garnock-Jones
On Tue, 6 Aug 2019 at 21:15, George Neuner wrote: > Sockets belonging to the crashed program are in a "half-closed" state - > unable to send, but still able to receive. If you look in netstat you'll > find their status is stuck in TIME_WAIT or in SYN or SYN/ACK. There is a > delay in cleaning

[racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-06 Thread Tony Garnock-Jones
On Tuesday, August 6, 2019 at 6:27:51 PM UTC+1, David Storrs wrote: > > I should mention that the reason I'm looking into this is because I have > UDP sockets that are not getting closed. They are managed by custodians, > but the custodians are not releasing them; I take this to mean that the

[racket-users] Re: #lang something // infix, optionally indentation-sensitive experimental Racket syntax

2019-07-21 Thread Tony Garnock-Jones
On Sunday, July 21, 2019 at 3:57:56 PM UTC+1, Tony Garnock-Jones wrote: > > Recent threads have reminded me I never properly announced "#lang > something", an experiment from back in 2016. > I forgot to mention I also made a recording of #lang something/shell in acti

[racket-users] #lang something // infix, optionally indentation-sensitive experimental Racket syntax

2019-07-21 Thread Tony Garnock-Jones
Hi everyone, Recent threads have reminded me I never properly announced "#lang something", an experiment from back in 2016. The main idea is S-expressions, but with usually-implicit parentheses and support for prefix/infix/postfix operators. Indentation for grouping is explicitly represented in

[racket-users] Alpine-based docker racket images

2019-02-16 Thread Tony Garnock-Jones
Hi all, Just a quick note to let anyone interested know I've built some Racket 7.2 docker images: one "full" and one "minimal", from the respective source tarballs, and for both "x86_64" and "aarch64". I'm still working on armhf. There's also a manifest set up against tags "latest" (for full)

[racket-users] Re: The performance of ‘set’ vs. lists+‘remove-duplicates’

2018-12-05 Thread Tony Garnock-Jones
I suspect it will be slow because sets are generics, and generics are slow. For my application, it has worked well to replace set/seteq with hash/hasheq mapping to #t; this only works when you have total control over set representation as an implementation detail, of course! But for me it sped

Re: [racket-users] Re: What is the best way to daemonize a Racket program on linux?

2018-12-02 Thread Tony Garnock-Jones
%20Daemons On Thu, 29 Nov 2018 at 15:19, Brian Adkins wrote: > Just out of curiosity, why do you feel using daemon(3) is not a great > idea? I'm not disagreeing, just curious about your reasons. > > On Thursday, November 29, 2018 at 5:54:42 AM UTC-5, Tony Garnock-Jones > wrote:

Re: [racket-users] Re: What is the best way to daemonize a Racket program on linux?

2018-12-02 Thread Tony Garnock-Jones
17 -0800 (PST), Brian Adkins > wrote: > > >Just out of curiosity, why do you feel using daemon(3) is not a great > idea? > >I'm not disagreeing, just curious about your reasons. > > > >On Thursday, November 29, 2018 at 5:54:42 AM UTC-5, Tony Garnock-Jones > >wrot

[racket-users] Re: What is the best way to daemonize a Racket program on linux?

2018-11-29 Thread Tony Garnock-Jones
IMO using daemon(3) is not a great idea. Instead, I like to use djb's daemontools https://cr.yp.to/daemontools.html to supervise my processes. For example, see the `README` and the `run` script in https://github.com/tonyg/racket-reloadable-example. Tony On Thursday, November 29, 2018 at

Re: [racket-users] cons-specific optimizations?

2018-11-28 Thread Tony Garnock-Jones
On Wednesday, November 28, 2018 at 2:43:26 AM UTC, Matthew Flatt wrote: > > The compilers in both cases know some facts about how `cons` relates to > other primitives, but they also know how structure constructors and > accessors relate, so it's not as big a difference at that level. > There

Re: [racket-users] Re: maintainer for alpine linux racket package (cloud containers and handhelds)

2018-11-14 Thread Tony Garnock-Jones
king with > upstream. Until then, Racket-Minimal contents is a great start. > > A volunteer who wants to join the Alpine Linux guild, learn their > rituals and secret handshakes, and represent Racket well, would do a > great service. > > > Tony Garnock-Jones wrote on 11/14/18 6:19

[racket-users] Re: maintainer for alpine linux racket package (cloud containers and handhelds)

2018-11-14 Thread Tony Garnock-Jones
I recently experimented with Alpine packages for Racket 7.x, minimal and full, but ran out of steam when I realised I didn't know whether "minimal" and "full" even make sense in context. Is there a need for an "ultra minimal"? Anyway, APKBUILD etc (partially cribbed from Jakub Jirutka's Racket

[racket-users] Configuration as main file (was Re: #lang languages and cyclic dependencies)

2017-11-29 Thread Tony Garnock-Jones
On 11/28/2017 11:58 PM, Jack Firth wrote: > What if the configuration file was the main module of your app, instead > of something imported by your app? I've tried this, and it works well. I haven't used a custom config #lang yet, but even with regular old Racket, it works very well. For

[racket-users] let-immutable

2017-11-05 Thread Tony Garnock-Jones
Would it make sense to have a `let-immutable` form that was just like `let` but that forbade use of `set!` with introduced variables? I'm thinking it could be handy for authors of libraries that introduce a lot of bindings in DSLs where mutability has to be strictly controlled. I think it is

Re: [racket-users] tabular text display

2017-09-22 Thread Tony Garnock-Jones
Not yet parameterised or extracted for separate use, but: raco pkg install tabular https://github.com/tonyg/racket-tabular/blob/29e91c9475407da4c5bee03abc2e6043693b3ff6/tabular/main.rkt#L681-L765 Example output: Welcome to Racket v6.10.1.1. > (require (submod tabular test)) > (require

Re: [racket-users] SWIG

2017-09-14 Thread Tony Garnock-Jones
I have a library for uPNP and NAT-PMP: https://github.com/tonyg/racket-nat-traversal. It's not on the package server for lack of round tuits, but it might be of interest. Certainly a lot nicer not to have to go for an FFI when a Racket library might be able to do the job. Cheers, Tony On

Re: [racket-users] pkgs.racket-lang.org log in is down

2017-08-29 Thread Tony Garnock-Jones
Thanks, Philip -- I've restarted the server. We need better monitoring for it, but I don't have the time to fix it at the moment. It'd also be great for Racket in general to have better visibility into running programs to see what's going wrong with them in situations like this. All I could

Re: [racket-users] Simple define-require-syntax question

2017-06-18 Thread Tony Garnock-Jones
On 06/17/2017 08:02 PM, Matthew Flatt wrote: > As a `require` form, a `submod`'s binding context is taken from the > parenthesis around the `submod`. With options (A) and (B), the context > of those parentheses is macro-introduced. Thanks! So this `submod` binding context is being used to mark

[racket-users] Simple define-require-syntax question

2017-06-17 Thread Tony Garnock-Jones
#lang racket ;; ;; Hi all (Matthew in particular I imagine :-) ), ;; ;; Why does option (C) work, but options (A) and (B) do not? ;; ;; They fail with: ;; ;; t.rkt:31:2: v1: unbound identifier in module ;; in: v1 ;; context...: ;;standard-module-name-resolver ;; ;; -- Tony (require

Re: [racket-users] Creating struct types that default parent type fields

2017-06-02 Thread Tony Garnock-Jones
On 06/02/2017 02:05 PM, David Storrs wrote: > Suppose I have the following: > [...] One possible option is http://pkgs.racket-lang.org/package/struct-defaults: ~$ racket Welcome to Racket v6.6.0.4. > (require struct-defaults) > (struct my-exn exn:fail ()) > (define-struct-defaults mk-my-exn

Re: [racket-users] OpenSSL vs. NaCl/libsodium

2017-05-01 Thread Tony Garnock-Jones
On 4/30/17 11:51 PM, James wrote: > I think we want standard TLS. I know enough about cryptography to > know that I really don't want to roll my own. So I guess OpenSSL is > what we'll use but then, maybe, something else for local file > cryptography and signing. We might even use OpenPGP as a

Re: [racket-users] OpenSSL vs. NaCl/libsodium

2017-04-28 Thread Tony Garnock-Jones
Hi James, On 4/28/17 1:13 PM, James wrote: > https://github.com/mgorlick/CRESTaceans/tree/master/bindings/libsodium > https://github.com/tonyg/racl/tree/master I'm the author of racl. I've not used mgorlick's code, but one thing to bear in mind is that it uses libsodium, where racl uses plain

Re: [racket-users] Package documentation link issue

2017-04-11 Thread Tony Garnock-Jones
Thanks, Philip -- that could well be a bug in the catalog UI. I can't check it out until after the OOPSLA deadline, so I've filed https://github.com/tonyg/racket-pkg-website/issues/42 to keep track of it until then. Regards, Tony On 04/11/2017 01:21 PM, Philip McGrath wrote: > I recently

Capturing Unix signals (was Re: [racket-users] Best way to ensure threads finish in GUI application?)

2017-01-31 Thread Tony Garnock-Jones
Hi Erich, On 01/31/2017 08:23 AM, Erich Rast wrote: > Related to that, does application-quit-handler capture signals on > Linux, and if so, which ones, and/or is there a way to install signal > handlers in Racket? There's a package, https://pkgn.racket-lang.org/package/unix-signals, that

Re: [racket-users] Re: inflate/deflate

2017-01-13 Thread Tony Garnock-Jones
On 01/12/2017 11:32 PM, Lehi Toskin wrote: > `number->bytes`, is a function I made; its definition is > (define (number->bytes num) > (define hex (number->string num 16)) > ; from file/sha1 > (hex-string->bytes (if (even? (string-length hex)) hex (string-append "0" > hex You might be

Re: [racket-users] Re: inflate/deflate

2017-01-13 Thread Tony Garnock-Jones
On 01/12/2017 11:32 PM, Lehi Toskin wrote: > P.S. I didn't see an implementation of ADLER32 anywhere, so I had to write my > own, which took a little longer than expected, but oh well. Oh, cool. That'd probably be a useful thing for Racket's net/git-checkout module, which has a piece of code in

Re: [racket-users] Re: inflate/deflate

2017-01-12 Thread Tony Garnock-Jones
Hi Lehi, On 01/12/2017 06:17 PM, Lehi Toskin wrote: > Now that I think about it, it's probably naive of > me to simple add those two bytes and expect everything to actually be > working as expected [...] I'm assuming the Z_BUF_ERROR is being > reported because it's not as flexible and the

Re: [racket-users] handling terminal input per character

2016-10-30 Thread Tony Garnock-Jones
On 10/30/2016 10:54 AM, Ken MacKenzie wrote: > So what is the best way to read keypress or character by character > input in racket. For now dealing with a CLI/terminal interface to > keep it simple as I work to test and refine my methods. Try the "ansi" package,

Re: [racket-users] Putting Racket into the database or, more sanely, storing continuations

2016-10-29 Thread Tony Garnock-Jones
On 10/28/2016 08:21 PM, David Storrs wrote: > Is it possible to take (e.g.) a procedure object and decompose it back > into its original source code? I don't believe this is possible without murky unsafe programming, but... > One (bad) idea that came to mind was to simply shove some Racket code

Re: [racket-users] opinions on YAML as communication tool

2016-10-21 Thread Tony Garnock-Jones
On 10/21/2016 01:21 AM, 'John Clements' via Racket Users wrote: > I thought hard about scribble and JSON (and xml, yecch), but I think > that YAML and sexps are the two viable candidates, and I’m guessing > that if non-programmers have to edit it, they’ll be less likely to > botch the YAML one.

Re: [racket-users] Writing binary data

2016-10-18 Thread Tony Garnock-Jones
On 10/18/2016 12:27 AM, David Storrs wrote: > On Mon, Oct 17, 2016 at 8:39 PM, Sam Tobin-Hochstadt > > wrote: > I think the `integer->integer-bytes` function is probably what you want. > > Thanks Sam, that does the trick. You might also

Re: [racket-users] Racket apps on Android

2016-09-30 Thread Tony Garnock-Jones
On 09/30/2016 04:07 PM, Tony Garnock-Jones wrote: > On 09/30/2016 03:38 PM, Jay McCarthy wrote: >> This could mean a few things... >> - "basic" still uses "simulator.rkt" and not "tablet.rkt" > > I haven't checked, but all I did was take the c

Re: [racket-users] Racket apps on Android

2016-09-30 Thread Tony Garnock-Jones
On 09/29/2016 08:05 PM, Jay McCarthy wrote: > The build system that Byron Davies and I implemented for deploying > full-screen OpenGL Android apps is available here: > > https://github.com/jeapostrophe/racket-android This is great! I'm trying a build now on debian stretch. I've sent a pull

Re: [racket-users] aws package fails against google cloud storage

2016-09-07 Thread Tony Garnock-Jones
On 09/06/2016 02:40 PM, 'John Clements' via Racket Users wrote: > Obvious fixes that I don’t like: > > 1) stop using google cloud storage, starting using Amazon S3. > 2) use the old PLaneT version instead of the shiny new pkg version. > > Any other suggestions? 3) maybe there's a "google API"

Rendering 2htdp/image to bitmap% (was Re: [racket-users] Re: Error message from GUI)

2016-08-02 Thread Tony Garnock-Jones
On 08/02/2016 04:27 PM, Robby Findler wrote: > 2htdp/images can be 0xN or Nx0 just fine. If you wish to render them > to a bitmap, does the file/convertible library not work for you? For me? No, I needed a bitmap% object rather than a file. Tony -- You received this message because you are

Re: [racket-users] Re: Error message from GUI

2016-08-02 Thread Tony Garnock-Jones
On 07/29/2016 12:26 PM, George Neuner wrote: > I don't see any obvious utility in being allowed to create a zero > sized bitmap. Likewise a widget or a canvas. It is useful when writing code that handles images generically. For example, and this is a real example where the zero-size-bitmap error

[racket-users] Are fixnums guaranteed to be `eq?` whenever they are `=`/`equal?` ?

2016-03-14 Thread Tony Garnock-Jones
Hi all, Can I rely on the truth of the following: (implies (and (fixnum? x) (fixnum? y) (= x y)) (eq? x y)) ? I know I can rely on something similar for symbols. What other sorts of values can I rely on eq? being an appropriate equivalence predicate for? Tony -- You received

Re: [racket-users] do loops

2016-02-15 Thread Tony Garnock-Jones
If your "insert" is idempotent, and you have some means of measuring tree size, you can eliminate i, c and x: (define tree4 (do ([tree null (insert tree (random 10))]) [(>= (tree-size tree) 5) tree])) I arrived at this by considering doing something similar for sets: (define tree4 (do

Re: [racket-users] (atanh -2) -> +nan.0

2015-10-07 Thread Tony Garnock-Jones
On 10/07/2015 10:19 AM, Brian Adkins wrote: > If I instead call: (atanh (number->float-complex -2)) I do get a > complex result. I was surprised to see that (atanh (make-rectangular -2 0)) => +nan.0. -- You received this message because you are subscribed to the Google Groups "Racket Users"

Re: [racket-users] fail on http server response not actually a failure?

2015-10-06 Thread Tony Garnock-Jones
On 10/06/2015 03:12 PM, George Neuner wrote: > My (maybe wrong) understanding is that the response/* functions only > package the response data for the send/* functions to transmit. They construct a `response` struct which includes an `output` procedure which, given a port, is to write the

Re: [racket-users] fail on http server response not actually a failure?

2015-10-06 Thread Tony Garnock-Jones
On 10/06/2015 12:43 AM, George Neuner wrote: > I don't know where to put an error handler to deal with reset conditions > at the end of a request. Maybe Jay has an idea? It feels like exceptions are something that response/full, response/xexpr and similar procedures could deal with, since they

Re: [racket-users] RabbitMQ

2015-09-10 Thread Tony Garnock-Jones
On 09/10/2015 01:21 PM, Jack Firth wrote: > Has anyone implemented a RabbitMQ client in racket? Is anyone working > on it and partway there? I'm trying to set up a distributed task > system like Celery in Python which needs the workers to be in > Racket. I recommend implementing STOMP rather than

Re: [racket-users] Comparing (delimited) continuations in Racket

2015-08-14 Thread Tony Garnock-Jones
On 08/14/2015 11:16 AM, Robby Findler wrote: The color of a television, tuned to a dead channel. Bright, pure, sky blue? What an unusual grey. https://twitter.com/DJSundog/status/629659761902948352 -- You received this message because you are subscribed to the Google Groups Racket Users

Re: [racket-users] RCP over racket-stomp

2015-08-07 Thread Tony Garnock-Jones
On 08/07/2015 03:19 PM, Jukka Tuominen wrote: =ERROR REPORT 7-Aug-2015::22:00:25 === Channel error on connection 0.5764.4 ([client-ip]:59326 - [server-ip]:61613, vhost: '/', user: 'device7'), channel 1: {amqp_error,access_refused, access to queue

Re: [racket-users] RCP over racket-stomp

2015-08-06 Thread Tony Garnock-Jones
On 08/06/2015 02:03 PM, Jukka Tuominen wrote: From a generic STOMP documentation I’ve understood that I should send a ”reply-to” header item with a temporary queue value, but I’m not sure about the format I should use in racket-stomp. I tried... #:headers `((receipt ,receipt)(persistent

[racket-users] Tool to assist in reverse-engineering one's own code?

2015-07-13 Thread Tony Garnock-Jones
Hi all, I'm going through a library I wrote, trying to find all (transitive) callers of a certain group of functions. Is there any tool that will help me in this? I'm thinking of something akin to a hybrid between racket/trace and the profiler, where you mark the functions (like you do with

Re: [racket-users] Emacs Lisp as a Racket Language?

2015-07-03 Thread Tony Garnock-Jones
On 07/03/2015 01:11 PM, William G Hatch wrote: I would also love to see a new emacs based on Racket. Is rmacs by Tony Garnock-Jones intended to be a small project or is he meaning for it to grow to be a serious contender with emacs, vim, etc? At the moment, it's just for my own edification

Re: [racket-users] Gear VR

2015-07-01 Thread Tony Garnock-Jones
On 07/01/2015 01:13 PM, Neil Toronto wrote: There's every chance that Typed Racket's union types, singleton symbol types, and occurrence typing will make it fairly easy to type an s-expression-based wire protocol; e.g. (define-type Command (List 'command-name arg-types ...) (define-type

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

2015-06-12 Thread Tony Garnock-Jones
On 06/12/2015 03:15 AM, Michael Titke wrote: In my understanding the pseudo random number generator is deterministic. That means for the same input seed /random/ will always return the same value. This is why one usually has to set a new state for each call of random. If you're generating

Re: [racket-users] exn-string

2015-05-26 Thread Tony Garnock-Jones
On 05/25/2015 11:16 AM, Greg Hendershott wrote: Should there maybe be a parameter to control whether exn-string returns anything interesting? And, should it be #f by default? That's an interesting idea. I know of examples where Racket error reports have disclosed sensitive information. Such

[racket-users] racket-explorer now deals with cyclic/mutable data

2015-05-22 Thread Tony Garnock-Jones
Hi all, I've updated racket-explorer (https://github.com/tonyg/racket-explorer) to handle cyclic (and mutable) data by lazily (and repeatedly) unfolding children only when the triangle next to an item is opened (and every time it is opened). If you've tried it before and been discouraged at its

Re: [racket-users] racket on openwrt devices

2015-05-03 Thread Tony Garnock-Jones
On 2015-05-02 2:29 PM, Neil Van Dyke wrote: What's the current viability of running Racket on a small OpenWRT device? (Anything new, such as due to the recent modularization of the core?) Nothing that I know of since 2011ish. The smaller core might make it a little easier to assemble a

Re: [racket-users] racket on openwrt devices

2015-05-03 Thread Tony Garnock-Jones
On 2015-05-03 2:50 PM, Neil Van Dyke wrote: 128 RAM and 128 NAND flash, albeit with a different SoC with lower CPU clock rate. I don't want to rely on USB Storage for this project. I should mention also that I couldn't do anything useful with Racket 5.x (as it was at the time) on the