pocmatos
2018-6-12 09:31:31

Is there a way to do interface inheritance? For example, I want to provide the customer with an interface to implement but I want to force him to implement not only the functions of the interface itself but also gen:equal+hash. So, I want my interface to include functions from other interfaces as well.


abmclin
2018-6-12 12:36:20

@pocmatos yes interface supports multiple inheritance, you can include as many super-interface-expr as you want in the interface expression. https://docs.racket-lang.org/reference/createinterface.html


pocmatos
2018-6-12 12:39:55

@abmclin Those are interfaces for classes, I was talking about generic interfaces for structs. define-generics seems to be the closest we have to interface but for structs.


pocmatos
2018-6-12 12:41:43

@greg do you know how to disable auto pair mode with either paredit or smartparens. I can’t understand how anyone likes that. I much prefer the drracket way where once on a top of a paren (which I insert) I get the paren region highlighted. Do you know how to achieve this? i.e. not just highlight the open paren but the whole region?


abmclin
2018-6-12 13:04:29

@pocmatos ahh yeah I don’t know much about struct inheritance mechanisms


greg
2018-6-12 13:28:03

@pocmatos By “auto pair mode” do you mean the behavior of paredit, smartparens, or electric-pair-mode where typing e.g. a ( where none exists adds the )? Or something else?


pocmatos
2018-6-12 13:28:22

that’s it.


pocmatos
2018-6-12 13:28:37

I can’t disable it in any of the modes and I have tried both paredit and smartparens.


greg
2018-6-12 13:29:15

idk about smartparens but in paredit it’s effectively a requirement — paredit pretty much depends on the buffer being a valid sexpr at all times


pocmatos
2018-6-12 13:30:11

oh… shame. Oh well. I will disable them. I really don’t like the behaviour. :slightly_smiling_face: Thanks.


greg
2018-6-12 13:30:47

FWIW I tried paredit — and gave up on it — probably four or five times over the course of a couple years.


greg
2018-6-12 13:31:00

Then I tried it again, and it stuck hard ¯_(ツ)_/¯


pocmatos
2018-6-12 13:31:05

so you use smartparens with this electric behaviour?


greg
2018-6-12 13:31:15

I use paredit


pocmatos
2018-6-12 13:31:29

oh… stuck hard…


pocmatos
2018-6-12 13:31:33

i read suck hard. :slightly_smiling_face:


greg
2018-6-12 13:32:01

Oops. :slightly_smiling_face: Yeah my point it is I thought it sucked hard until eventually I thought it was brilliant.


pocmatos
2018-6-12 13:32:16

I can’t deal with it at the moment, drives me crazy to see all those parens growing after my cursor.


greg
2018-6-12 13:34:04

You also mentioned highlighting. highlight-parentheses-mode only highlights the parens. It probably wouldn’t be hard to hack it to highlight the whole region. But. When I use paredit mode, I trust the sexpr navigation so much I barely “see” the parens. So, I don’t use any highlighting.


greg
2018-6-12 13:35:56

Also: If you’re using racket-mode, and disable paredit mode, you could try this DrRacket ripoff: https://github.com/greghendershott/racket-mode/blob/master/Reference.md#racket-smart-open-bracket


pocmatos
2018-6-12 13:36:00

Yeah, I have the highlight-parentheses-mode but it’s not enough. I really would like to get the whole region highlighted.


greg
2018-6-12 13:37:41

Or maybe that’s more auto-magic-pixie-dust you’d rather avoid :slightly_smiling_face:


greg
2018-6-12 13:39:00

highlight-parens-mode does have hl-paren-background-colors (defaults to nil) but alas that only sets the background color of the parens themselves, not the region between


pocmatos
2018-6-12 13:40:33

I have a feeling that’s already enabled in racket-mode for me because I have that feature and no smartparens or paredit.


pocmatos
2018-6-12 13:41:36

Yeah, need to find a way to highlight the region between as well. I wonder if I can sort something out using hightlight.el https://www.emacswiki.org/emacs/HighlightLibrary


greg
2018-6-12 13:45:32

One could use highlight-parentheses.el as a starting point. It uses two Emacs “overlays” to highlight the open and close. Moves them. Instead could use one overlay, that you move and resize over the region. Something like that.


pocmatos
2018-6-12 13:51:19

Yes, my elisp-fu is pretty rusty but it’s not much code so I will give it a try. :slightly_smiling_face:


greg
2018-6-12 13:59:48

A lot of the code by volume seems to support the configuration options. (Isn’t that always the case. Stupid user preferences complicating our elegant code. :smile:) So if this will be just hardcoded to @pocmatos then it might get even simpler.


pocmatos
2018-6-12 14:02:49

… reading about overlays. :slightly_smiling_face:


jerome.martin.dev
2018-6-12 15:09:01

Ok so I made a silly procedure and I’m wondering if it already exists somewhere or if we should add it to racket/function: (define (thunkpose . thunks) (if (pair? thunks) (thunk ((car thunks)) ((apply thunkpose (cdr thunks)))) void)) Behold the marvelous thunkpose! A mix of thunk + compose!


jerome.martin.dev
2018-6-12 15:12:03

It’s obviously more imperative than functional, because composing thunks is mostly about creating (begin ...) clauses and wrap’em in lambdas, but I needed a way to build processes that will execute later in a specific order.


lexi.lambda
2018-6-12 15:13:33

I think you could write that more easily just by writing: (define ((thunkpose . thunks)) (for ([thunk (in-list thunks)]) (thunk)))


jerome.martin.dev
2018-6-12 15:14:21

Definitely better :smile:


notjack
2018-6-12 16:13:21

I love the name thunkpose


stamourv
2018-6-12 16:37:36

@andreiformiga: Re feature-profile: from the error, it looks like the program you’re trying to profile has its own expectations wrt command-line arguments (i.e., none) that conflict with raco feature-profile. You may want to try calling feature-profile from inside your program instead.


pocmatos
2018-6-12 17:51:06

Does anybody have any example of the use of id/c created by a define-generics? I can’t understand how to use this. The documentation exists but it’s not entirely clear to me. Github search isn’t of much help.


asumu
2018-6-12 18:34:54

pocmatos
2018-6-12 18:39:03

@asumu true, the code helps. thanks.


asumu
2018-6-12 18:40:22

Yeah the docs should probably be more clear on its use. I’m also not sure it turned out to be a very useful feature…


ghoetker
2018-6-12 19:20:05

@mflatt Following up on yesterday. Launching Dr. Racket today gave the usual splash screen. However, the problem with missing menu items remains. The keyboard equivalents (CMD - and CMD = ) work as intended. Any hints? Please let me know if there is any information you need or debugging steps you would like me to take. Thank you.


mflatt
2018-6-12 19:23:27

I meant to follow up: this problem should be fixed for the next release. Please try a snapshot from http://pre.racket-lang.org\|pre.racket-lang.org to see if it works on your machine. (Note: since the snapshot archives are still not signed, you’ll need to drag the DrRacket app out of its folder and back in – which tells the OS that you trust the application enough that right-clicking and “Open” should work. Really.)


mflatt
2018-6-12 19:24:23

The problem was related to the on-demand callback for menu items, where the technique to detect a mouse click on the menu bar doesn’t work with Mac OS 10.13.


ghoetker
2018-6-12 20:15:32

@mflatt Thank you for the quick follow-up. Unfortunately, I’m getting the same problem.


mflatt
2018-6-12 20:19:50

Just to make sure, the version that DrRacket shows is “7.0.0.1”?


ghoetker
2018-6-12 20:30:55

@mflatt yes


andreiformiga
2018-6-12 20:31:48

@stamourv thanks, I think this is the issue


mflatt
2018-6-12 20:34:36

@ghoetker Another long shot, but what does this program print when you run it (in any version of Racket)? #lang racket/base (require ffi/unsafe ffi/unsafe/define) (define appkit-lib (ffi-lib (format "/System/Library/Frameworks/AppKit.framework/AppKit"))) (define-ffi-definer define-appkit appkit-lib) (define-appkit NSAppKitVersionNumber _double) NSAppKitVersionNumber


leif
2018-6-12 21:03:19

@mflatt, @robby, or @jeapostrophe (not sure which), are you aware that you can’t compile Racket 6.12 from the repo?


robby
2018-6-12 21:05:33

I am aware


robby
2018-6-12 21:05:36

you want @stamourv


robby
2018-6-12 21:06:05

@dan may be able to help with the right incantations if this is a question about how to get it working and not a bug report


leif
2018-6-12 21:08:00

Ah, okay.


samth
2018-6-12 21:08:32

@leif I think there’s a bug report on the racket repo somewhere that has the instructions


samth
2018-6-12 21:08:37

or a mailing list post


leif
2018-6-12 21:08:58

In this case, @stamourv> Ya. When I do:

git clone git@github.com:racket/racket.git
cd racket
git checkout v6.12
make

I get: Using cached15288364681528836468332 for <git://github.com/racket/plot/?path=plot-compat> raco pkg install: version mismatch for dependency for package: 2d-lib mismatch packages: base (have 6.12, need 6.90.0.19) make[1]: *** [plain-in-place] Error 1 make: *** [in-place] Error 2


leif
2018-6-12 21:09:23

@samth Instructions on how to get around this?


samth
2018-6-12 21:09:28

yes


samth
2018-6-12 21:09:46

we know that what you just posted is what happens


samth
2018-6-12 21:10:11

if you want racket 6.12 from source, then I recommend downloading it from http://download.racket-lang.org\|download.racket-lang.org


samth
2018-6-12 21:11:18

see https://github.com/racket/racket/issues/2022 and linked issues for more discussion of this


ghoetker
2018-6-12 21:16:12

@mflatt Running the provided code in either version of Dr. Racket (7.0.0.1 or 6.12) gives the same answer: 1561.4. Please let me know what else I can do to help debug, if anything. Thank you.


leif
2018-6-12 21:37:05

@samth Hmm..okay, thanks.


stamourv
2018-6-12 21:38:09

@leif: FWIW, this will be fixed in 7.0 and subsequent releases.


mflatt
2018-6-12 22:39:12

Still looking for differences between your setup and mine… Does your machine have multiple screens? Or a Retina display?


ghoetker
2018-6-13 00:36:51

@mflatt Okay, now we’re just in the world of weird. I have a MacBook Pro with a retina display. My issues to date have been while running DrR with the notebook closed and two 23-inch (1920 x 1080) displays attached. I unplugged one display, launched DrR (6.12) and all was well. Shut DrR down, reconnect the other monitor, launch DrR again and…everything seems to work as normal, even though I once again have two monitors attached. I’ve tried this dance several times and the problem seems to be staying fixed!? Actually, there was one time that the menu spots were initially blank, but filled the second time I opened the View menu. That’s different from before. I’ve not been able to recreate it. It is stuck on being fixed which is (a) great for me and (b) lousy for debugging. Do you want to declare victory or is there anything I can do to help continue debugging?


mflatt
2018-6-13 00:50:17

Ah, that seems like useful information. The implementation of on-demand involves checking whether a click hits the menu bar, but I have to implement the check at a lower level in the graphics pipeline than I usually get to use. I’m not clear on all the relevant coordinate transforms that I need to apply. I may be able to provoke problem and sort out coordinate issues by working with multiple displays and changing the relative positions of the displays. Thanks!


mflatt
2018-6-13 00:53:14

One more test would be helpful, if you have time, because I don’t have a Retina display for my High Sierra machine: When you’re using just the laptop screen, does the menu look right when you click at the highest possible point in the menu name? At the lowest possible point? Unfortunately, you’ll need to restart DrRacket between those tests to get an accurate result. The intent of this test is to help check whether I need to worry about scaling, as opposed to just offsets.


ghoetker
2018-6-13 01:18:43

On just my laptop screen, I am now seeing no problem whether I click at the menu on its highest or lowest point. I restarted DrR between tests as you indicated. Just ask if I can try anything else.


matt.singletary
2018-6-13 02:09:30

@matt.singletary has joined the channel


mflatt
2018-6-13 02:33:04

I’ve pushed changes to accommodate multiple screens, and a snapshot will be ready tomorrow morning U.S. time. I’m assuming that you have the default Mac OS display settings where there’s a separate menu bar at the top of each screen. In that case, as of yesterday’s snapshot, only one of the menu bars would have worked right, and now both should work right. (So it wasn’t a coordinate-system problem, but that I forgot how menu bars work with multiple displays in modern Mac OS.)


ghoetker
2018-6-13 02:59:46

@mflatt Wonderful. Thank you. Should I grab it from http://pre.racket-lang.org\|pre.racket-lang.org to give it a test?


mflatt
2018-6-13 03:15:48

Yes, when the snapshot changes to one that starts “20180613”.