sorawee
2021-5-20 08:09:24

Ah, we have compile-omit-paths in the sdsl directory


markus.pfeiffer
2021-5-20 10:59:59

another silly question: is it (easily) possible to have drracket remove trailing whitespace from source?


pocmatos
2021-5-20 11:24:26

Can’t say from the top of my head as I mostly use Emacs. However, I think it’s not possible from vanilla DrRacket (someone might correct me here). I would however look at quickscript for a possible way to implement this feature.


mflatt
2021-5-20 11:29:59

A raco setup will never install packages. That is, raco pkg install uses raco setup, but not the other way around. I guess I’m not clear on how you have sudoku-solver in some cross-build target without having raco cross ... pkg installed it there. (Every cross configuration will have its own package installations.)


plevexier
2021-5-20 12:25:29

@plevexier has joined the channel


spdegabrielle
2021-5-20 12:27:17

There is a key combo to remove extra white space at the current position


spdegabrielle
2021-5-20 12:27:42

Look in the menu- ‘show active keybindings’


spdegabrielle
2021-5-20 12:30:28

Otherwise a ‘remove trailing white space’ could probably could be implemented in quickscript https://docs.racket-lang.org/quickscript/\|https://docs.racket-lang.org/quickscript/


plevexier
2021-5-20 12:31:16

@pocmatos which package are you using for racket on emacs, I tried to set racket-mode, it was a bit, how can I say, degraded compared to DrRacket


plevexier
2021-5-20 12:32:18

compared to say slime, it was a bit disappointing


soegaard2
2021-5-20 12:33:53

@plevexier Don’t forget to try racket-xp-mode (part of racket-mode). https://racket-mode.com/ Also Greg has a couple of videos explaining the features of racket-mode: https://www.youtube.com/results?search_query=racket-mode


plevexier
2021-5-20 12:35:06

ah, I may have missed racket-xp-mode


plevexier
2021-5-20 12:35:15

thank you, gonna check


plevexier
2021-5-20 12:36:32

when all is setup correctly, would you say it has all the features from drracket, besides the debugger



jaz
2021-5-20 12:38:11

though this predates quickscript


spdegabrielle
2021-5-20 12:40:59

Would you mind if I made a quickscript out of that plugin code?


jaz
2021-5-20 12:43:18

not at all


soegaard2
2021-5-20 12:43:41

There is a nice feature that took me a while to discover: If you run the program and the cursor is inside a test submodule, it runs the tests. If the cursor is outside, then the program is run normally.


spdegabrielle
2021-5-20 12:44:17

Thanks. Can I also encourage you to put it on the Racket Package Catalog ? https://pkgs.racket-lang.org/\|https://pkgs.racket-lang.org/


soegaard2
2021-5-20 12:44:32

FWIW here is my .emacs with some “DrRacket”-like keybindings for racket-mode: https://gist.github.com/soegaard/942a3074513655292816e0b79c466620


plevexier
2021-5-20 12:45:47

excellent, when I configured it, I only set up a few keybindings, so gonna check what I miss


plevexier
2021-5-20 12:47:56

and you also have great gists and good repos in there :slightly_smiling_face:


markus.pfeiffer
2021-5-20 12:51:13

:heart:


pocmatos
2021-5-20 13:51:56

@plevexier using racket-mode + xp, but I love a minimalistic ide setup - so it’s more than enough for me.


pocmatos
2021-5-20 13:52:18

Love DrRacket and use it for the macro expander but I use emacs for everything so using it for racket as well is definitely a plus on my environment.


spdegabrielle
2021-5-20 13:53:57

it is not uncommon for people to use both Racket Mode and DrRacket - switching as required.


plevexier
2021-5-20 13:54:57

right, makes sense, gonna try to configure racket-mode with xp and see how far it brings me, but yeah, I see how using drracket sometimes is necessary


plevexier
2021-5-20 13:58:30

I’ve been spoiled with slime (which is the package for common lisp) I think


samth
2021-5-20 13:59:05

For me, DrRacket and racket-mode + racket-xp-mode are somewhat incomparable at the moment. For example, the macro stepper in DrRacket is much better than equivalents in racket-mode. Similarly, other languages that are build as DrRacket tools just don’t exist in racket-mode. And DrRacket separates tabs from each other, which is nice. However, racket-mode is much better for “go to definition”, easier to enable errortrace on demand, and other conveniences.


plevexier
2021-5-20 13:59:38

true @samth


samth
2021-5-20 13:59:54

I think neither one is much like slime, because slime is based around a fairly different model of interaction with the underlying system that Racket itself has moved away from.


plevexier
2021-5-20 14:00:04

yes


plevexier
2021-5-20 14:00:28

and for the best really sometimes lol


plevexier
2021-5-20 14:01:04

the image based programming has a lot of sharp edges


toblux
2021-5-20 14:09:03

#lang racket/base (require quickscript racket/string) (define-script whitespace #:label "Remove trailing whitespace" (λ (selection) (let ([linebreak (string #\newline)]) (string-join (map (λ (line) (string-trim line #px"\\s+" #:left? #f)) (string-split selection linebreak)) linebreak)))) It doesn’t remove trailing newlines at the end of the file, but otherwise it’s been working for me.


sschwarzer
2021-5-20 14:16:00

> A raco setup will never install packages. Ok, that explains the behavior, thanks.

> I guess I’m not clear on how you have sudoku-solver in some cross-build target without having raco cross ... pkg installed it there. I ran raco cross ... exe ... from the root of my Git working directory. It may actually be that the package wasn’t installed at that time.

For context, so far I only ran raco cross with the same target as my host environment. Technically, this would of course be rather useless, but it should work and it simplifies testing because I’m able to run the generated binary without copying it to another system. So at this point, for my first experiments, I’m using raco cross to wrap raco exe, but I’m not actually cross-compiling.


rostislav.svoboda
2021-5-20 14:29:24

Hi. Is there any quickscript for structured editing in DrRacket? Something like smartparens or paredit in emacs?


sschwarzer
2021-5-20 14:30:21

Eventually, I want to use raco cross ... exe ... to create standalone binaries so that users can download the compiled program without having to install Racket.


samth
2021-5-20 14:31:33

rostislav.svoboda
2021-5-20 14:35:01

Thanks! Hmm, that was easy, but I couldn’t find it myself. Looks like the google is broken today


samth
2021-5-20 14:35:30

laurent.orseau
2021-5-20 15:05:43

Nice and simple :slightly_smiling_face: I had also written one for my own needs some time ago, but forgot to publish it—it’s https://gist.github.com/Metaxal/971e7a4d3098ac45930381beb02f8892\|here. This one removes the trailing spaces in the whole current tab, not just in the selection. (Also, https://github.com/racket/racket/wiki/Quickscript-Scripts-for-DrRacket\|wiki updated.)


markus.pfeiffer
2021-5-20 17:59:02

has become increasingly enamored with DrRacket


soegaard2
2021-5-20 20:05:11

In racket/draw/unsafe/cairo.rkt the identifier _cairo_matrix_t-pointer isn’t exported. The struct is defined as: (define-cstruct _cairo_matrix_t ([xx _double*] [yx _double*] [xy _double*] [yy _double*] [x0 _double*] [y0 _double*]) #:malloc-mode 'atomic-interior) (provide (struct-out cairo_matrix_t)) So I am thinking, that a hypothetical cstruct-out also exporting the -pointer binding would be a good thing. But I have a feeling, I might be overlooking something.

Is there way to get a _cairo_matrix_t-pointer other than simply duplicating the define-struct above in my own code?


mflatt
2021-5-20 20:14:32

While it would be better for _cario-matrix_t-pointer to be exported, I think (define-cpointer-type _cairo_matrix_t-pointer #:tag 'cairo_matrix_t) is equivalent.


markus.pfeiffer
2021-5-20 20:15:38

Thanks guys, I am now getting all sorts of ideas what I’d like to do to/with drracket :wink:


soegaard2
2021-5-20 20:16:13

Thanks for the tip - works like a charm.


jestarray
2021-5-20 21:21:19

https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/racket-racketbc.html looks like cs now beats bc in the majority of benchmarks! a lot more memory usage though


notjack
2021-5-20 23:40:25

I think I’d rather that case just throw an exception by default


notjack
2021-5-20 23:42:34

you can do (-> foo? foo? ... bar?) to require 1 or more foo? arguments


notjack
2021-5-20 23:43:35

I think you can do this without macros


notjack
2021-5-20 23:45:28

oh yup I see that’s what you did, nevermind me :p


philip.mcgrath
2021-5-21 00:45:41

When using a snapshot package catalog, is there a good way to tell what commits were used for Git-based packages? What about release catalogs and https://pkg-build.racket-lang.org/server/built/catalog/?


mflatt
2021-5-21 01:03:08

No, I don’t think that’s recorded anywhere.


hazel
2021-5-21 03:22:12

hi, can someone explain this behavior to me? ~ λ racket Welcome to Racket v8.1.0.5 [cs]. > (require plot/pict) > (define whatever (hash plot-pen-color-map 'set1)) > (parameter-procedure=? plot-pen-color-map (first (hash-keys whatever))) #t > ~ took 28s λ cat whatever.rkt File: whatever.rkt 1 #lang racket 2 (require plot/pict) 3 (provide whatever) 4 5 (define whatever (hash plot-pen-color-map 'set1)) ~ λ racket Welcome to Racket v8.1.0.5 [cs]. > (require "whatever.rkt" plot/pict) > (parameter-procedure=? plot-pen-color-map (first (hash-keys whatever))) #f seems unpredictable, but I might be wrong about some fundamental assumption


hazel
2021-5-21 03:22:54

this also happens if I just (define whatever plot-pen-color-map)


hazel
2021-5-21 03:25:58

cc @samth — could this have something to do with Typed Racket’s exported contracts or parameter guards?


sorawee
2021-5-21 03:29:58

What is plot/pict? Whenever I require it, whether from the REPL or DrRacket, the program crashes

$ racket Welcome to Racket v8.1.0.6 [cs]. > (require plot/pict) fish: Job 1, 'racket' terminated by signal SIGKILL (Forced quit)


hazel
2021-5-21 03:46:02

update: https://gist.github.com/ralsei/a5cbaad4c649bcf82c4fa1abbb2ce35d

looks like this is behavior that’s unique to typed-untyped interaction, maybe?