leafac
2016-11-15 10:14:03

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


jbelmont
2016-11-15 14:02:02

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


leafac
2016-11-15 14:33:00

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.


leafac
2016-11-15 14:33:25

Also, good luck with your Code Craftsmanship Saturdays group.


badkins
2016-11-15 14:50:54

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.


leafac
2016-11-15 14:58:13

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?


leafac
2016-11-15 15:00:59

My current workaround is to close and reopen the file in DrRacket. But a better solution would be welcome.


badkins
2016-11-15 15:01:51

leafac <shift> <cmd> E


badkins
2016-11-15 15:01:59

in DrRacket


badkins
2016-11-15 15:02:31

It’s Revert in the file menu


leafac
2016-11-15 15:11:14

Hey, this works! Thanks a lot! :slightly_smiling_face:


badkins
2016-11-15 16:19:42

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-&gt;pos (valid-queen-moves board (pos-&gt;idx #"d4") is-black-piece?))


badkins
2016-11-15 16:21:51

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.


badkins
2016-11-15 16:31:13

lexi.lambda
2016-11-15 17:07:08

@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


badkins
2016-11-15 17:11:43

not sure how it might work with a list of args though


badkins
2016-11-15 17:12:11

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:


badkins
2016-11-15 17:12:33

is amazed that everyone doesn’t find Scheme code the most beautiful!


thinkmoore
2016-11-15 18:39:17

@leafac File -> Revert will reload from the file on disk without closing and reopening


thinkmoore
2016-11-15 18:39:39

oh sorry, someone already answered


leafac
2016-11-15 18:49:36

@thinkmoore: Thanks anyway :+1: