xxue
2020-9-16 07:55:03

@xxue has joined the channel


xuxue
2020-9-16 07:56:43

@xuxue has joined the channel


stevenkw
2020-9-16 13:46:34

Hello all, Is there a way to move a line of code up or down one line at a time in the DrRacket IDE? for example cmd-shift-upArrow moves up one line and cmd-shift-downArrow move down one line. I didn’t see it in the keybindings. Is there a way to add the functionality? Thanks! example


spdegabrielle
2020-9-16 14:13:25

There is transpose-sexp (esc;c:t), but no line orientated function.



stevenkw
2020-9-16 14:17:37

Thanks @spdegabrielle, I’ll check out those links. I’m taking a class that uses Racket and I’m really enjoying it. I don’t want to get sidetracked :slightly_smiling_face: but I’m sure I’ll get into adding this at some point.


laurent.orseau
2020-9-16 14:22:02

Damn, I can’t resist these script-baits :smile: Here’s a quickscript that should solve your problem: https://gist.github.com/Metaxal/77f5f33d558b0739ee6eff27e1d4f62e The keys are Ctl-Shift-Up and Ctl-Shift-Down, but of course these can be changed.


laurent.orseau
2020-9-16 14:23:59

@stevenkw


stevenkw
2020-9-16 14:26:33

ha ha script-bait :joy: I’ll add this in right away! Thanks very much! @laurent.orseau


laurent.orseau
2020-9-16 14:27:52

@spdegabrielle It’s been added to https://github.com/racket/racket/wiki/Quickscript-Scripts-for-DrRacket (so you don’t have to do it)


stevenkw
2020-9-16 14:33:11

Very cool! You whipped that up quick! heh


stevenkw
2020-9-16 14:40:40

Wow that’s great! Works like a charm. So good!


spdegabrielle
2020-9-16 17:19:50

[ANN]Call for beta-testers: racket templates

We have a small collection of templates at https://github.com/racket-templates and a command that helps you use them.

I’ll do a formal release in the next Racket News, but in the meantime it would be great if you have a few free moments to try the tool and a template (or two) let me know if you see any problems.

You can download a template straight to your computer with the command raco from-template <template repo name> <destination folder> e.g. the following command creates a new folder in the current directory and populates it with the contents of the guiapp template. raco from-template guiapp mygui

Thanks to<https://github.com/nixin72/from-template| Philip> we have an extension to raco that adds the from-template command.

Thanks also go to @andre for getting it working for windows.

It should go something like this; % echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Applications/Racket v7.8/bin:/opt/X11/bin:/Library/Apple/usr/bin % raco pkg install from-template Resolving "from-template" via <https://download.racket-lang.org/releases/7.8/catalog/> Resolving "from-template" via <https://pkgs.racket-lang.org> Downloading repository <https://github.com/nixin72/from-template.git> […]raco setup: --- installing collections ---             [17:55:59] raco setup: --- post-installing collections ---          [17:55:59] % mkdir templatetests % cd templatetests  % raco from-template guiapp mygui guiapp /Users/spdegabrielle/Dev/templatetests/ Cloning into 'mygui'... remote: Enumerating objects: 25, done. remote: Counting objects: 100% (25/25), done. remote: Compressing objects: 100% (19/19), done. remote: Total 25 (delta 8), reused 13 (delta 3), pack-reused 0 Unpacking objects: 100% (25/25), done. #t % ls mygui % cd mygui % Please try it out and let me know if you identify any problems. Suggestions appreciated!


spdegabrielle
2020-9-16 17:24:19

you don’t need to use the tool -all the repos are set as github ‘Template repositories’ these let users generate new repositories with the same directory structure and files from within the github user interface.


laurent.orseau
2020-9-16 17:28:42

Do you mind if I use your gif as a demo? (to be put in the comments of the gist)


spdegabrielle
2020-9-16 17:28:54

raco pkg install from-template to install the tool, raco from-template &lt;templatename&gt; &lt;folder&gt; ’ to use


samth
2020-9-16 17:55:32

That’s awesome! One suggestion — a raco command template.


samth
2020-9-16 17:55:51

Another suggestion — a #lang template


spdegabrielle
2020-9-16 17:59:13

@samth The from-template raco command is a raco command template in true self-referential style: https://github.com/racket-templates/from-template\|https://github.com/racket-templates/from-template


spdegabrielle
2020-9-16 18:00:40

A #lang template is an awesome idea - can you suggest one? I’ll ask the author for permission! @samth


samth
2020-9-16 18:09:53

Here’s something you could start with: https://github.com/samth/xlang


greg
2020-9-16 18:25:05

@spdegabrielle Should this include a step about renaming main.scrbl to $PACKAGE-NAME.scrbl? https://github.com/racket-templates/racket-package-template#how-to-use


samth
2020-9-16 18:25:53

it would be awesome if the command could do that for you


greg
2020-9-16 18:26:01

(I guess a more-general question is whether this situation is frequent enough that templates should have “template variables”)


greg
2020-9-16 18:26:23

Ah @samth as usual beat me to it and more succinctly. :slightly_smiling_face:


greg
2020-9-16 18:27:40

I honestly don’t know if turning this into something with template variables using e.g. scribble/text is a solution in search of a big-enough problem, or not. But wanted to at least point out the conflicting .scrbl problem.


samth
2020-9-16 18:28:18

I think variables are maybe unnecessary, but a few specific changes might be nice


greg
2020-9-16 18:29:58

Maybe the from-template raco command could look for some optional code a specific template supplies, and if found, run it.


greg
2020-9-16 18:30:19

And each template could do whatever simple or fancy configuration seems good for that template.


greg
2020-9-16 18:30:54

Like look for a .from-template.rkt file? idk


spdegabrielle
2020-9-16 18:55:49

spdegabrielle
2020-9-16 19:27:40

Thanks @samth https://github.com/samth/xlang\|https://github.com/samth/xlang saves me asking the author!



soegaard2
2020-9-16 20:51:37

After updating macOS to 10.15.5, I am suddenly getting this error, when I try to start the web-server: racket web/server.rkt ffi-obj: couldn't get "nettle_hashes" from "libnettle.dylib" (dlsym(0x7fc445f20d20, nettle_hashes): symbol not found) context...: "/Users/soegaard/Library/Racket/7.5/pkgs/crypto-lib/private/nettle/ffi.rkt": [running body] (on Racket BC 7.5).

Has anyone seen something similar?


soegaard2
2020-9-16 21:02:08

@ryanc


soegaard2
2020-9-16 21:02:47

I think the problem stems from an update to libnettle that affects crypto.


sorawee
2020-9-16 21:07:42

https://docs.racket-lang.org/scaffold/ supports template variables, FWIW


soegaard2
2020-9-16 21:22:44

Hmm. I don’t think it was an update to macos afterall. I installed a program using brew yesterday, and that made brew install a new version of libnettle.

% mdfind libnettle /usr/local/Cellar/nettle/3.6/lib/libnettle.8.0.dylib /usr/local/Cellar/nettle/3.6/lib/libnettle.a /usr/local/Cellar/nettle/3.4.1/lib/libnettle.6.5.dylib /usr/local/Cellar/nettle/3.4.1/lib/libnettle.a


ryanc
2020-9-16 21:58:26

@soegaard2 I think I already fixed that problem, so make sure you have latest version of the crypto-lib package. Then if you still see the problem, let me know and I’ll take another look.


soegaard2
2020-9-16 22:02:01

@ryanc Oh! Yep. It works. Feel silly now. For some reason didn’t even think to update crypto. Thanks for the help.


sorawee
2020-9-16 22:24:04

@ryanc is there a way to get this code to output #t?

#lang racket (require syntax/parse) (module a racket (provide a) (define a 1)) (require (rename-in 'a [a b]) (for-syntax (rename-in 'a [a c]))) (syntax-parse #'b [{~literal c #:phase 1} #t] [_ #f])


ryanc
2020-9-16 22:31:55

IIUC, you want to compare c at phase 1 with b at phase 0. I think you cannot do that with ~literal, but you can do it with define-literal-set.


sorawee
2020-9-16 22:34:05

Ah, thanks.


stevenkw
2020-9-16 23:43:39

Sure no problem, and thanks again!


stevenkw
2020-9-17 00:07:09

Here is one done in DrRacket. Use either one.


spdegabrielle
2020-9-17 00:55:45

@sorawee trying it out now