
@xxue has joined the channel

@xuxue has joined the channel

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

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

@stevenkw you should be able to roll your own with https://docs.racket-lang.org/drracket/Keyboard_Shortcuts.html#%28part._defining-shortcuts%29 or https://docs.racket-lang.org/quickscript/index.html

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.

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.

@stevenkw

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

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

Very cool! You whipped that up quick! heh

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

[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!

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.

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

raco pkg install from-template
to install the tool, raco from-template <templatename> <folder>
’ to use

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

Another suggestion — a #lang template

@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

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


@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

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

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

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

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.

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

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

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

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

@greg I’m thinking it might be better to use https://github.com/racket-templates/racket-package-template#how-to-use\|https://github.com/racket-templates/racket-package-template#how-to-use as a basis to extend raco pkg new

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

Thanks @samth added as https://github.com/racket-templates/xlang\|https://github.com/racket-templates/xlang

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?

@ryanc

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


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

@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.

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

@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])

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
.

Ah, thanks.

Sure no problem, and thanks again!

Here is one done in DrRacket. Use either one.

@sorawee trying it out now