On Thursday, December 10, 2015 at 2:33:32 AM UTC+8, Matthew Butterick wrote:
> Here's one good way to promote the language:
> 1) Make something impressive with Racket.
Not the original poster, but does this count?
it is a fitness tracker for
On Thursday, December 10, 2015 at 9:01:24 AM UTC+8, Emmanuel Oga wrote:
> On Wednesday, December 9, 2015 at 3:32:24 PM UTC-8, Alex Harsanyi wrote:
> > On Thursday, December 10, 2015 at 2:33:32 AM UTC+8, Matthew Butterick wrote:
> > > Here's one good way to promote the
I'd like to add that the 32bit version of Racket 6.5 works fine and displays
actual numbers. It seems that this would be a bug in the 64 bit version?
On Thursday, June 2, 2016 at 8:24:42 PM UTC+8, Alex Harsanyi wrote:
> I'm trying to use dump-memory-stats to find out where my applicat
I'm trying to use dump-memory-stats to find out where my application uses its
memory, unfortunately, it does not seem to print out any usefull info. When
calling it with no arguments I get the value "???64d" for everything:
I have the same problem with Racket 6.4 64Bit Windows (running on Windows 7):
> (time (total 10))
cpu time: 85520 real time: 88070 gc time: 204
BTW, my "Choose Language" dialog box (Ctrl+L) has the following selected:
* Populate "compiled directories"
ebug" disabled, "Preserve stack trace" enabled -> 4.5 seconds
* "Debug" and "Preserve stack trace" disabled -> 3.6 seconds.
> > On Mar 2, 2016, at 8:21 PM, Alex Harsanyi <alexharsa...@gmail.com> wrote:
> > I have the
On Saturday, April 2, 2016 at 9:03:30 PM UTC+8, Robby Findler wrote:
> After you make the changes, run "raco setup" from the command line and just
> wait. Everything should be good after that. (No need to delete anything.)
Thanks, Robby, this worked.
You received this message because
I'm getting an error when trying to create an executable for a program that
uses the math/statistics module. The simplest example that reproduces the
(let* ([s empty-statistics]
[s (update-statistics s 1)]
Thanks for the quick reply. I will try a snapshot build of Racket in a few
Unfortunately, if I just make the changes you suggested in Racket 6.4 and
remove the corresponding .zo and .dep files, I just get linkage errors when I
start Racket. However, this is due to my
The option to create an executable from DrRacket worked fine for me in Racket
6.4 and several prior versions.
However, this particular problem also happens when I use
`create-embedded-executable' (which ultimately raco exe uses), which is how I
build my application. I noticed it
This might be a wild guess, but are you using typed/racket as the language? On
my machine (Windows 7, DrRacket 6.6), if I use #lang typed/racket, evaluate it
than type "Hello World" in the REPL, it takes about 2 seconds to display the
result (after that it seems to run fast). If I just use
On Friday, August 12, 2016 at 10:09:21 AM UTC+8, gustavo wrote:
> I have these strange times in a microbenchmark that compares the time
> to run hash-ref when the key is in the hash and when it is not there:
> #lang racket/base
> (define hash0 #hash((0 . #t)))
> (define hash1 #hash((1 .
On Monday, June 27, 2016 at 3:03:27 PM UTC+8, Normal Loone wrote:
> I currently want to write a program that includes writing out stuff written
> in the buffer. But I cant seem to write out strings stored in text% properly.
> (define txt (new text%))
> (send txt insert
Structures support this style of updating:
(struct foo (bar baz) #:transparent)
(define one (foo "hello" 1))
;; Copy all fields from "one" and update baz to 2
(define two (struct-copy foo one (baz 2)))
They also have immutable fields by default.
Occasionally, my Racket application crashes with a segmentation fault (under
Windows). The crash is a NULL pointer reference. Unfortunately, having no
PDB's the stack trace only contains a list of addresses.
Unfortunately, this only happens occasionally, but under the same conditions.
On Tuesday, February 21, 2017 at 3:12:50 AM UTC+8, lu wrote:
> Hi all, I have this little toy project to help me learn the language. I
> would like to produce a single portable executable that can be executed
> without reliance on racket installation. `raco distribute` does produce a
I'm a bit confused about how raco test is reporting the number of tests run, if
a test case is defined outside a test suite. If I run the program below:
"My Test case"
On Tuesday, February 21, 2017 at 11:52:49 AM UTC+8, Lehi Toskin wrote:
> In `get-file-list` there is a filter argument that can be passed to the
> function such that when going through a directory it'll only list directories
> and those files in the filter (separated by a semicolon). This can
On Wednesday, March 1, 2017 at 5:30:06 AM UTC+8, David K. Storrs wrote:
> I'm sending this to the list because I suspect I'm not the only one who will
> ever have this issue and the next person should now be able to google for it.
> GNU Emacs 24.5.1
> Darwin MacBook-Pro.lan 15.5.0 Darwin
On Thursday, March 2, 2017 at 10:56:30 AM UTC+8, Philip McGrath wrote:
> Almost — thanks! (I'm sure I read over that page of the docs, but I somehow
> missed 'vscroll.)
> The one thing that isn't working is scrolling with the mouse/trackpad. It
> seems like I might need to override
On Thursday, March 2, 2017 at 7:12:22 PM UTC+8, erich wrote:
> Hi! I have a simple non-editable and non-resizable snip% class that in
> its draw function distinguishes whether it's selected or not. It works
> fine when I select it in a text% with the mouse.
> Now I want to select it in the
How about using channels:
(define handle-channel (make-channel))
(define (handle-producer ch)
(let loop ((counter 1))
(channel-put ch counter)
(loop (add1 counter
(thread (lambda () (handle-producer handle-channel)))
I believe the message means that the width you specify is greater than the max
value you also specify. That is, you probably call it as (set-column-width i
715 0 596), which could happen if 'perc' is greater than 100.
You can verify that by printing out all the values and checking them.
According to the documentation for the canvas<%> interface you cannot rely on
the canvas not being cleared
Even when the canvas’s style suppresses explicit clearing of the canvas, a
canvas may be erased by the windowing system
I'm using plot-snip% objects in my application to display plots.
Data and parameters of these plots needs to change based on GUI
input. To do that I updated the snip-canvas% object to allow
replacing the snip held in the editor-canvas%. Unfortunately,
whenever a new snip is inserted, even
, Matthew Flatt wrote:
> Use the `set-max-undo-history` method to enable undo history:
> (send m-edit set-max-undo-history 1000)
> At Tue, 20 Sep 2016 06:24:49 -0700 (PDT), Alex Harsanyi wrote:
> > Consider the following example (this is pretty much the code from
On Wednesday, September 21, 2016 at 10:42:33 AM UTC+8, Robby Findler wrote:
> It is a performance issue and the default saves memory when one creates a lot
> of little text% objects.
> Maybe we should add something to the docs. Where did you look?
The overview section for editors could
Consider the following example (this is pretty much the code from
http://docs.racket-lang.org/gui/editor-overview.html?q=text%25 except I also
added a text-field%):
(define f (new frame% [label "Simple Edit"]
Your tick format function returns less labels than the number of items in the
pre-ticks. It should return one label for each pre-tick object (I just printed
out the lengths from the function to find this out.)
To fix this, I replaced the format function with
(for/list (((t idx)
On Saturday, October 15, 2016 at 9:19:20 AM UTC+8, Robby Findler wrote:
> Is there a contract we could add somewhere?
Well, the contract should be that the number of elements in the output list
should be the same as the number of elements in the input list. I'm not sure
how that would be
You could try using a point-label or a function-label with a point size of 0,
(plot (list (function-interval sin (lambda (x) 0))
(function-label (lambda (x) (* (sin x) 0.2)) -1.8 "sin(x)"
#:x-min -2 #:x-max 2)
On Saturday, October 15, 2016
What types of values can be cached by with-cache?
I tried to use it with a data-frame object I use in my application (wanted to
check if it is faster to retrieve it from the filesystem than the database),
but unfortunately it failed with:
; with-cache: Internal error: failed to make
While in terms of O-notation, all linear algorithms are equivalent, the actual
time to run a linear algorithm can significantly depend on the actual data
structure. In the program below, I calculate the sum of the elements of a
vector or list in three ways, all of them linear algorithms.
On Thursday, October 13, 2016 at 12:01:44 AM UTC+8, Matthew Flatt wrote:
> In this case, things will work better if you use
> $ bin/raco pkg update --catalog https://pkgs.racket-lang.org htdp
I tried to run this command (as I also would like to work on some built in
packages), and after
On Saturday, January 14, 2017 at 12:15:50 PM UTC+8, Lawrence Bottorff wrote:
> I've seen Racket graphics doing some basic graphics. How expressive is it?
> Could it do diagrams as well as TikZ or gnuplot? What output formats are
> there? Could it be like Processing and do 3-d and motion?
Without seeing the code, this is just a blind guess, but try "(send canvas
refresh)" in the implementation for your "set-bitmap" method.
On Thursday, December 1, 2016 at 4:28:02 PM UTC+8, Hersh Krishna wrote:
> So I'm making a frame which draws a bitmap that can be replaced
I would like to embed versioning and build date information in my application
executable, and I'm not sure how to do that. To clarify, in C or C++, I would
write the following:
#define APPVER "no version"
Perhaps I should have clarified this better, but
My application is an executable built with "create-embedding-executable", not a
package, I'm not sure that the info.rkt can be compiled and packaged inside an
I would like to have this information compiled as a .zo file and embedded into
On Saturday, January 14, 2017 at 10:48:26 PM UTC+8, Lawrence Bottorff wrote:
> This is all very impressive, indeed. I was wondering if Racket could be used
> to create a new sort of GIS app, i.e., geographic information system. It
> would have to do "vector graphics," which is to say every
On Monday, April 10, 2017 at 10:06:35 AM UTC+8, Alex Harsanyi wrote:
> Unfortunately, the above command has resulted only in the plot package being
> linked to the repository:
> $ raco pkg show -l
On Sunday, April 9, 2017 at 10:52:48 PM UTC+8, Matthew Flatt wrote:
> Meanwhile, I expect that you can repair the installation by deleting
> "share/info-cache.rktd" and running `raco setup`. Alternatively, the
> snapshot from Utah at
> should also
On Tuesday, April 18, 2017 at 5:15:12 AM UTC+8, Jens Axel Søgaard wrote:
> 2017-04-17 22:56 GMT+02:00 Vincent St-Amour :
> (For people following along, the issue is that there exists a value `x`
> such that `(= (+ x 1e-17) x)`, and that the iteration reaches that
On Monday, April 17, 2017 at 11:41:59 PM UTC+8, Alexander McLin wrote:
> The error message is unclear but I believe SQLite do not support parameters
> for PRAGMA statements.
I worked extensively with Racket + SQLite and I can attest that the "multiple
statements given" message should be
On Friday, March 3, 2017 at 7:18:27 AM UTC+8, schuster wrote:
> The problem is that a test-case expression runs a test immediately; it does
> not return a test object to be run later. In your case, the test runs while
> my-test-case is being defined, then no test at all actually runs
On Tuesday, August 1, 2017 at 8:45:25 PM UTC+8, david.vanderson wrote:
> On 07/31/2017 10:46 PM, Alex Harsanyi wrote:
> > Unfortunately, `define-runtime-path` can only be used at top-level, so the
> > above code does not compile. It works fine without the
> > `define-runt
On Tuesday, August 1, 2017 at 4:59:14 AM UTC+8, Vincent St-Amour wrote:
> Racket version 6.10 is now available from
I just updated to Racket 6.10 on Windows 10 and noticed a bug that causes a
crash (access violation). This happens when there is a symbolic link in a
There's a problem with the sqlite interface where "multiple statements given"
error is reported for any syntax error. This was fixed only recently. See
On Wednesday, April 26, 2017 at 12:12:26 PM UTC+8, David K. Storrs wrote:
> I could do it with a parameter but that's only sweeping the above ugliness
> under the rug:
> (define conf (make-parameter #f))
> (define (read-conf)
> (or (conf)
On Wednesday, April 26, 2017 at 12:09:54 PM UTC+8, Daniel Prager wrote:
> Much as I enjoy making images using 2htdp/image it does get a tad slow as
> complexity increases.
> I currently have a program in which I generate images in 2htdp/image and
> translate them into bitmap%s per racket/gui
I would also like to know more about this topic. I have never done any
rigorous tests, however for my application which takes about 7 seconds to load,
I have observed the following:
* there is no big startup difference between running the application as "racket
run.rkt" (which loads the
On Friday, April 28, 2017 at 10:04:52 PM UTC+8, Matthew Flatt wrote:
> I notice that your code calls `running-stickman-icon` on startup, which
> takes about 2 seconds on my machine.
Well, this is embarrassing for me. I remember adding that code in and having
to decide on whether to wait 2
On Friday, April 28, 2017 at 6:40:06 PM UTC+8, Daniel Prager wrote:
> The reason is that what I really want to do is more complex layouts, for
> which 2htdp/image or pict combiners make life a lot easier.
The code to convert to bitmap allocates the bitmap and draws to the bitmap. In
On Friday, April 28, 2017 at 2:47:41 AM UTC+8, Dupéron Georges wrote:
> Thank you Matthew for the explanation.
> If I understand correctly,
> * Alex Harsanyi's start-up time is due to run-time (phase 0) initialisation
> code in the required libraries, including things like (define v
I'm trying to write a function to keep the SQL query text outside of the
Racket source code, as this would make it easier to write and test the SQL
Instead of writing:
(define query (virtual-statement (lambda (dbsys) "select ...")))
I would like to put the "select ..." part in a
On Tuesday, August 1, 2017 at 12:11:24 PM UTC+8, gneuner2 wrote:
> Hmm. A change to a query often also means a change to its arguments
> and/or its result columns, so I don't see that there is much utility
> in keeping the query strings separate from the program.
I just noticed that the GUI test runner displays "test did not clean up
resources" messages on my tests, but it is not clear to me what resources are
not being cleaned up.
I tried to reproduce the problem in the following test case:
(require rackunit rackunit/gui db)
You need to execute the statements one by one and write code that reads the
I have written code to read a SQL schema definition file and create a database
from it, you can find it here:
The `db-open` command
On Thursday, June 1, 2017 at 8:06:30 AM UTC+8, andrew blinn wrote:
> I'm trying to use a assign a keypress to toggle the display of the border of
> an embedded editor-snip. Currently pressing the toggle key only toggles the
> border of the topmost snip, whereas I want to toggle the border most
I don't have an answer to your problem, but I'm curious as to what do you store
in "local.rkt" and "production.rkt" to justify such a complicated solution.
In the projects that I worked on (Racket or otherwise), local vs production
differ in the values for different parameters,
> Van: email@example.com <firstname.lastname@example.org> namens
> Alex Harsanyi <alexharsa...@gmail.com>
> Verzonden: vrijdag 15 september 2017 7:53
> Aan: Racket Users
> Onderwerp: [rac
On Tuesday, September 12, 2017 at 4:46:18 AM UTC+8, Alexis King wrote:
> Furthermore, if this problem really is a lost cause, what are futures
> actually useful for? The documentation would imply that they are useful
> for lots of number crunching using machine integers or flonums, but
On Tuesday, August 22, 2017 at 12:53:20 AM UTC+8, Ryan Culpepper wrote:
> On 08/20/2017 09:28 PM, Alex Harsanyi wrote:
> > I just noticed that the GUI test runner displays "test did not clean up
> > resources" messages on my tests, but it is not clear to me what res
On Monday, August 21, 2017 at 2:39:06 PM UTC+8, Jack Firth wrote:
> On Sunday, August 20, 2017 at 6:28:20 PM UTC-7, Alex Harsanyi wrote:
> > I just noticed that the GUI test runner displays "test did not clean up
> > resources" messages on my tests, but it is not c
On Thursday, August 24, 2017 at 9:42:51 PM UTC+8, Matthias Felleisen wrote:
> Yes, Racket is a good language. But let me point you to the blog of a
> reflective developer, and I consider reflective developers the best of their
On Thursday, August 24, 2017 at 8:59:26 AM UTC+8, Neil Van Dyke wrote:
> h...@oorg wrote on 08/23/2017 06:56 PM:
> > Wouldn't making a DSL be overkill?
> No. In Racket, a DSL (aka minilanguage, syntax extensions, or macros)
> can be a very small implementation effort that does exactly
On Mon, Nov 13, 2017 at 5:26 PM, 'Paulo Matos' via Racket Users
> On 30/10/17 00:18, Alex Harsanyi wrote:
>> You could add ActivityLog2 (https://github.com/alex-hhh/ActivityLog2) to
>> that list (Disclaimer: I am the
I built a similar control, although it does not represent directory paths,
just labels which are stacked vertically. I ended up defining a structure
to hold the text and width + height of each label and keep these structures
in a list. In my case, all labels have the same size so converting a
I tested this on a Windows platform and have the same result. It seems
there is a problem in Racket with handling the right shift key: pressing
down the right shift key results in "keydown" being invoked with a "rshift"
argument, but releasing the right shift key results in "keyup" being called
I'm trying to use the "raco check-requires" command to determine which
requires I should remove from my source files, and the command fails when I
include one of my files (the application compiles and runs fine).
I managed to reproduce the case as follows:
;; Save this in "file1.rkt"
You forgot to add the racket users list to your message, so your reply
is sent to the mailing list. I fixed that.
On Fri, Nov 10, 2017 at 12:17 AM, Karim Djemai
> Hey Alex,
> thank you for your quick response!
> Is there any way for me to get the
In my code, I started experimenting with using immutable structs and
"updating" them using 'struct-copy'. I had to write my own "update"
functions, but I was surprised at how elegant the resulting code was. I
believe (although I did not check) that the guard function is invoked every
I have a problem with the Racket GUI where the main application window
focus if two dialog boxes are opened than closed. The problem occurs when
main window opens the first dialog box and the first dialog box opens the
second one on top of it. Once both dialog boxes are closed, the
On Wednesday, May 9, 2018 at 7:25:34 AM UTC+8, gneuner2 wrote:
Ignoring Racket's extraneous added panels, a better organization would be:
> Window 00010010 "" #32769 (Desktop)
> Window 0017076E "Hello World" PLTFrame
> Window 000F03D2 "Dialog 1" #32770 (Dialog)
On Tuesday, May 8, 2018 at 2:08:02 PM UTC+8, gneuner2 wrote:
> Hi Alex,
> So I guess the 1st question to answer is: does the GDI object have the
> correct parent HWND? [The Racket dialog% object has a parent, but does
> the underlying display object?] If it does, there's something
I am trying to create a path named "/foo/bar" in Racket on a windows
machine. build-path produces "/foo\\bar" and build-path/convention-type
does not seem to work:
> (path->string (build-path "/" "foo" "bar"))
"/foo\\bar" ; I am running on a Windows machine, so this is expected
> Roughly, strings don't work, because they have to be converted to bytes
> using the locale's default encoding. Although strings are allowed for
> the current platform's convention on the assumption that the current
> locale's encoding is the right one, we've avoided buildin
I wonder if *just solved your homework...*
(define (same-value? vec)
(define test-val (vector-ref vec 0))
(if (zero? test-val)
(let ((same? (for/and ((v (in-vector vec)))
(eqv? test-val v
(and same? test-val
(define (winner-by-row row-num)
I updated the plot package to cover all the cases I had in mind for plot
overlays and also updated my application to make use of these features,
just to make sure that they are adequate.
The pull request is here: https://github.com/racket/plot/pull/32, it would
be good if I
The racket plot package produces interactive snip% objects which allow
zooming of the plot area. While this is a cool and sometimes useful
feature, the functionality is hard coded in the plot-snip% class inside the
package. I would like to extend the package to allow the user to customize
On Saturday, February 10, 2018 at 10:00:29 AM UTC+8, Evan Whitmer wrote:
> Do you anticipate this playing well with charts that have multiple Y
> values for a given X value. For example, candlestick plotting
The recent plot library introduces a new function, `point-pict` which is
not yet available as part of a Racket distribution, and the plot package
has to be installed separately from GitHub for this function.
In my code I would like to be able to check if this function is available
ict (λ () #f))])
> (when point-pict
> (point-pict ...)))
> On Sat, Feb 17, 2018 at 7:57 PM, Alex Harsanyi <alexha...@gmail.com
> > wrote:
>> The recent plot library introduces a new function, `point-pict` which is
>> not yet avai
Get-size should work, can you provide a example that illustrates the
The only tricky bit is that the actual size of a widget is only computed
after it is shown. Here is an example:
(define toplevel (new frame% [label "hello"]
On Sunday, February 18, 2018 at 10:33:09 AM UTC+8, Robby Findler wrote:
> FWIW, the approach that is less friendly to your clients but perhaps
> easier for you (and maybe good enough for them) is to declare a
> dependency on a specific version in the info.rkt file of your pkg. The
You want to use a pasteboard% for the chess table and snip% objects for the
pieces. You can draw the board as the pasteboard background in the on-draw
You will have to implement snip management in the pasteboard though because by
default snips can just be dragged around and placed
On Thursday, August 2, 2018 at 11:19:58 PM UTC+8, Carlos Lopez wrote:
> Thanks Alex!
> Right, so make-bm is being called from another thread and so the
> parameters are different there.
The parameters should not be different. The objective of the save/restore
parameters is to make sure
On Friday, August 3, 2018 at 6:22:10 AM UTC+8, Alex Harsanyi wrote:
> On Thursday, August 2, 2018 at 11:19:58 PM UTC+8, Carlos Lopez wrote:
>> Thanks Alex!
>> Right, so make-bm is being called from another thread and so the
On Friday, August 3, 2018 at 1:24:08 AM UTC+8, johnbclements wrote:
> I hate to turn a little question into a big one, but… are parameters the
> right choice, here? It seems to me that optional parameters would be more
Most (but not all) parameters act as default values for
Parameters don't keep their values across threads, and since the plot
library needs to re-draw the plot when it is rotated or zoomed, it saves
parameters for later use in a different thread, where the drawing actually
happpens. There is an explicit list of parameters that are saved and
If this is a problem only in your test code, you could write a function to
reset/re-initialize the global state, and call that function at the
beginning of each test.
If you want to have a "global state" for each of the file that requires
your module, global variables might not be the right
I have used `change-children` on a Win32 GUI and the widgets that are
switched in and out keep all their state, including the scroll position,
unless, of course, if you change this state from the program.This
means, for example, that if you have a list-box% and you remove it from
On Friday, August 31, 2018 at 11:11:29 PM UTC+8, Matthew Butterick wrote:
> On Aug 31, 2018, at 3:25 AM, Alex Harsanyi > wrote:
> Is there a way to write this macro such that the runtime path is defined
> relative to the location of the file that uses `define-sql-
I have defined a macro to help with using SQL queries from external files:
uses `define-runtime-path` to store the path to the file and defines a
function that reads the data when called the first time and constructs a
(require racket/runtime-path db
I used the built-in url package (http://docs.racket-lang.org/net/url.html)
from Racket to fetch data from Wunderground weather API and it was simple
enough that I did not feel the need for a separate REST library. I just
used `format` to construct the URL, `get-pure-port` to fetch the data
I have version 22.214.171.124 installed from a few days ago, which appears to be
the latest version available at http://pre.racket-lang.org/, and "raco
exe" does not accept the '--embed-dlls' option. Have these changes not been
released in a snapshot yet?
On Monday, March 26,
On Tuesday, March 27, 2018 at 9:17:49 PM UTC+8, Matthew Flatt wrote:
> I should have bumped the version number when adding `--embed-dlls`, but
> I didn't. So, even though it's still version 126.96.36.199, `--embed-dlls`
> is in snapshots starting with the ones built on March 26.
I tried the
> At Thu, 22 Mar 2018 22:31:11 -0700 (PDT), Alex Harsanyi wrote:
> > I started getting some unexpected and unexplained errors from Racket
> > trying to build a stand alone executable. The versions is: Racket 6.12
> > 64bit
> > on Windows 10
The "traditional" way of doing this in other languages and GUI toolkits is
have a separate class for each of your panes (Books, Users and Rentals).
constructor would receive the parent widget and other initialization
parameters (e.g. a database connection). Something like this:
On Saturday, February 3, 2018 at 3:08:50 PM UTC+8, Alex Harsanyi wrote:
> Hi Matthias,
> I updated the plot package to cover all the cases I had in mind for plot
> overlays and also updated my appli
I started getting some unexpected and unexplained errors from Racket when
trying to build a stand alone executable. The versions is: Racket 6.12
on Windows 10.
If I try to run my application from Racket, it runs with no problems.
If I build an executable and try to run it, I get the
1 - 100 of 127 matches
Mail list logo