@jab: I’m happy to see that you eventually got the shortcut to work—even if with a different key combination. @jbelmont: I endorse @lexi.lambda’s suggestion. For years, I used Emacs as my only text editor (and not only as a text editor, but also email and news reader, time scheduler, password manager, contacts manager, you name it). Then, I started learning Racket and using DrRacket. Now I use two editors :slightly_smiling_face:
@leafac Yeah I used Dr. Scheme (PLT Scheme) briefly in college and heard that is now called Dr. Racket. It looks like a powerful editor/IDE to me. I created a group in Raleigh/Durham called Code Craftsmanship Saturdays and plan on doing some workshops in the future using Racket and wanted to see what tools/editors people use. I appreciate all the good feedback here.
I admit I tried to stick to Emacs with racket-mode. It is great, but there are some things Emacs was just not designed to do. For example, drawing arrows to represent variable bindings or showing 3D scenes on the REPL. That’s why I use DrRacket.
Also, good luck with your Code Craftsmanship Saturdays group.
It’s probably not ideal, but I often end up with both DrRacket and Emacs open - experimenting in the REPL and simple editing in DrRacket and long, more involved, editing sessions in Emacs. Then I just refresh the code in the other one.
I do sometimes use Emacs for Racket. For example, to do search and replace on a whole project. When I have the same file open on both editors, Emacs is able to pick up the changes from DrRacket, but DrRacket is not able to pick up the changes from Emacs. How do you handle this case?
My current workaround is to close and reopen the file in DrRacket. But a better solution would be welcome.
leafac <shift> <cmd> E
in DrRacket
It’s Revert
in the file menu
Hey, this works! Thanks a lot! :slightly_smiling_face:
Is there an existing Racket function to do what my poorly named unionify
does? (define (unionify f1 f2)
(λ args (append (apply f1 args)
(apply f2 args))))
(define valid-queen-moves (unionify valid-bishop-moves valid-rook-moves))
(map idx->pos (valid-queen-moves board (pos->idx #"d4") is-black-piece?))
I quickly wrote that for two, but in the spirit of Scheme, I’ll re-write it for a list of functions - i.e. take a list of functions and return a function that applies each function to the same list of args and then append all the result lists.
… moved to the mailing list: https://groups.google.com/forum/?hl=en#!topic/racket-users/fcqlH-gpiSc
@badkins: I think you could use something like wind-pre
from the point-free
package if you wanted to get fancy. http://docs.racket-lang.org/point-free/index.html#%28def._%28%28lib._point-free%2Fmain..rkt%29._wind-pre%29%29
not sure how it might work with a list of args though
someone replied that Clojure has juxt, so I just renamed my function: (define (juxt . funs)
(λ args (append-map (λ (f) (apply f args))
funs)))
that works :slightly_smiling_face:
is amazed that everyone doesn’t find Scheme code the most beautiful!
@leafac File -> Revert will reload from the file on disk without closing and reopening
oh sorry, someone already answered
@thinkmoore: Thanks anyway :+1: