pocmatos
2018-7-12 09:23:05

Also, I find it rather inconvenient that you have to run the buffer to get it to work. I assume I could run it each time I save.


pocmatos
2018-7-12 09:23:31

What is your usual workflow?


greg
2018-7-12 13:41:08

@pocmatos 1. IIRC the simple default completion in emacs is you hit C-M-i to run completion-at-point, which uses each major mode’s completion-at-point function to do the work. I basically like this — I don’t like completions popping up while I’m typing; just when I ask. The only change I make is, in my init.el to do (setq tab-always-indent 'complete). This lets me hit TAB instead of C-M-i. TAB will either indent or complete. That’s me. Other people like things like company-mode layered on top. I use it only to test racket-mode working with it.


greg
2018-7-12 13:46:06
  1. As for needing to run a racket buffer, before completion is enabled: That’s basically just because it needs to know what symbols are available from the #lang and your requires. Plus the requires have options like rename-in and prefix-in. Some of the required modules could have side-effects (writing/deleting a file, making a TCP connection, etc.), so I don’t think it’s really safe for racket-mode to go ahead and try to evaluate the requires to get a namespace. It should be your choice.

greg
2018-7-12 13:48:06

You were asking about completion. Similar rationale for M-. racket-visit-definition. “I understand that you’d like to visit the definition of select. Great! But, um, which select, because…” https://docs.racket-lang.org/search/index.html?q=select


greg
2018-7-12 13:48:43

So it has to run the file — evaluate it to a namespace in which identifiers have known specific meanings.


pocmatos
2018-7-12 14:04:30

thanks @greg for the clarification. I need to sit down and write a post on my racket workflow. Would be interesting to hear what others do as well then.


greg
2018-7-12 14:08:14

I’m open to suggestions or insights how to improve racket-mode. I’ve had a little more time to work on it, recently, than I have over the past couple years. I have been doing a lot of work on visit-definition the last week, for example, to make it better and faster, re your issue https://github.com/greghendershott/racket-mode/issues/288.


greg
2018-7-12 14:09:33

greg
2018-7-12 14:13:55

Do any experienced racketeers know how to fix https://github.com/racket/macro-debugger/issues/3 — that is, update check-requires for module+/module* submodules? I took a look 3 years ago and the code was waaaay over my head.


samth
2018-7-12 14:16:44

I think pinging @ryanc is the way to get that fixed


ryanc
2018-7-12 16:25:48

@greg I’ll try to take a look soon. It depends on what the binding information on references within the submodules looks like.


philip.mcgrath
2018-7-12 20:05:17

@mason.protter “High performance” seems to mean different things to different people. Racket is faster than Python. According to a 2014 paper (https://doi.org/10.1109/MCSE.2014.90) floating-point math in Racket is “within a factor of 3 of C’s speed when carefully tuned, which Typed Racket accelerates to within a factor of 1.5.” I think there is a use case for Racket in physics (or so I keep telling my physicist friend).


mason.protter
2018-7-12 20:10:34

That’s great to know! I’m primarily a julia user because the language is actually takes the lessons from lisp seriously (it even has macros on well structured expression datatypes!) and the community is very focussed on numerical computing so theres much more library level and compiler level support for the sorts of things I’m doing than on Racket but I definitely will have to start playing around with Racket soon, even if its just for hobby projects.


greg
2018-7-12 21:48:30

@ryanc Thanks. As a fallback, if it turns out that it can’t work for submodules — maybe show-requires could at least detect that situation and raise an exception? (If that would break backward-compat then maybe a new show-requires* that does so.)


greg
2018-7-12 21:51:00

[ Maybe I should do that anyway in racket-mode — check for such submodules and show an explanation message instead of calling show-requires — for the sake of people using versions of Racket older than one in which this might improve. ]


plotnus
2018-7-12 21:54:56

Is there a way to iterate through the fields of a struct? Here is what I’m trying to do: Given an instance of any type of struct, I want to do some operation on all fields with type foo, or just return a list of all fields with type foo. It should work for trees and not care about depth. Is something like this possible? (P.S. is this the right place to ask these kinds of questions?)


spall
2018-7-12 21:56:57

struct->list should produce a list you can iterate over


plotnus
2018-7-12 21:59:41

@spall thank you! Yes, I think something like that is what I needed. I’m still quite new to racket and the docs. Thanks again!


abmclin
2018-7-12 23:29:46

@plotnus welcome to the racket community! Yes you may ask those kind of questions here


mckinlay.andrew
2018-7-13 03:16:09

@mckinlay.andrew has joined the channel