hectometrocuadrado
2021-2-27 09:36:46

Can I know if a module has been imported or not?


sorawee
2021-2-27 09:45:21

module-declared? could do the job, I think.



sorawee
2021-2-27 09:46:42

E.g.,

#lang racket (module-declared? 'xml) ;=> #f but

#lang racket (require xml) (module-declared? 'xml) ;=> #t


hectometrocuadrado
2021-2-27 10:19:55

Thanks!


ryanc
2021-2-27 10:20:15

@dan.ml.901 What problem are you trying to solve? Usually define-match-expander is the right way to define new match forms. The prop:match-expander property is for the rare case when you want to define a name simultaneously as a match expander and as some other sort of static information carrier. That is, when the compile-time value associated with the name needs to be a single (struct) value that implements multiple interfaces.


hectometrocuadrado
2021-2-27 12:39:37

Is a good idea to use _ptr to receive pointer function arguments? (In the Racket FFI)


hectometrocuadrado
2021-2-27 12:42:55

I was trying (_ptr i functionType) and it is giving me errors


soegaard2
2021-2-27 12:48:19

hectometrocuadrado
2021-2-27 13:26:04

Thanks, but there is not what i’m looking for. I’ll keep searching


hectometrocuadrado
2021-2-27 13:27:20

hectometrocuadrado
2021-2-27 13:27:55

The glfw library uses _ptr for all function types


hectometrocuadrado
2021-2-27 13:28:04

Instead of only _fun



soegaard2
2021-2-27 13:31:19

Maybe * GLFWkeyfun was interpreted as a “pointer to a function” and then (_ptr ...) was added?

But if it works without, then I’d say just remove it.


hectometrocuadrado
2021-2-27 13:32:16

Yes, I thought that


hectometrocuadrado
2021-2-27 13:32:28

Thanks!


soegaard2
2021-2-27 13:34:59

soegaard2
2021-2-27 13:36:41

Maybe the difference is between us passing a function to the C side - and calling a C function in order to get a callback back? In the latter situation, the C side probably needs an “pointer to a cell in which store the function” aka (ptr o …).


hectometrocuadrado
2021-2-27 15:38:39

It seems that both files are the same


hectometrocuadrado
2021-2-27 15:40:02

Also, the definitions are not updated


hectometrocuadrado
2021-2-27 15:40:32

GLFW have more functions


hectometrocuadrado
2021-2-27 15:42:06

I think Im going to update it. Ill do a pull request when it is done


hectometrocuadrado
2021-2-27 19:03:37

Is this correct? (define-cstruct _GLFWgammaramp ([red (_ptr o _ushort)] [green (_ptr o _ushort)] [blue (_ptr o _ushort)] [size _int])) red, green and blue are pointers to unsigned short


hectometrocuadrado
2021-2-27 19:04:38

Or it should be (define-cstruct _GLFWgammaramp ([red _pointer] [green _pointer] [blue _pointer] [size _int]))


soegaard2
2021-2-27 19:19:00

Depends on how you intend to call them, I think. The first will allocate the ushorts automatically.


hectometrocuadrado
2021-2-27 19:35:44

That works?


hectometrocuadrado
2021-2-27 19:35:51

Nice then


hazel
2021-2-27 20:46:45

can someone open Racket (8.0, specifically) through the command line and press Ctrl-?


hazel
2021-2-27 20:48:19

I don’t know what this keybinding is supposed to do, but on my machine, it core dumps


hazel
2021-2-27 20:50:32

nevermind this occurs for every program


hazel
2021-2-27 20:50:38

that’s new


spdegabrielle
2021-2-27 20:51:00

Which os?


hazel
2021-2-27 20:51:12

NixOS, bash


hazel
2021-2-27 20:51:14

could just be a shell thing


hazel
2021-2-27 20:51:40

or a readline bug…


hazel
2021-2-27 20:54:04

JShell and Scala’s REPL behave really weird when I do this too Python, Racket, and R just abort GHCi doesn’t fail


hazel
2021-2-27 20:54:07

I think this is a readline issue


ryanc
2021-2-27 21:37:59

spdegabrielle
2021-2-27 21:43:39

A feature!


tgbugs
2021-2-27 21:58:02

a question about PLTCOMPILEDROOTS: when I run PLTCOMPILEDROOTS="$(racket -e '(display (path->string (cadr (current-compiled-file-roots))))')" racket I get the following error: Welcome to Racket v8.0.0.9 [cs]. path-list-string->path-list: contract violation expected: (listof path?) given: '(same #<path:/usr/lib64/racket/compiled>) Is this expected, or should same have been discarded?


tgbugs
2021-2-27 22:25:21

It seems that this is caused by an interaction between PLTCOMPILEDROOTS and the changes in https://github.com/racket/racket/commit/a110c58e521e6aa291895e177bd358c0cd7c623b which result in (compiled-file-roots . (same "/usr/lib64/racket/compiled")) being written to /etc/racket/config.rktd I will submit a github issue.



hazel
2021-2-27 22:47:14

wild


samth
2021-2-28 00:36:59

I use this a lot; it’s more effective with processes that don’t respond to ctrl-c


james.ng251
2021-2-28 07:46:41

@james.ng251 has joined the channel


james.ng251
2021-2-28 07:48:39

I’m on windows 10 home, I noticed with this new version 8, when I launch DrRcket for the first time (its ok) I close it and it won’t launch again until I restart my computer. Anyone facing the same problem?


james.ng251
2021-2-28 07:53:44

running DrRacket as Admin works


sorawee
2021-2-28 07:54:20

And in previous versions it works correctly, right?


james.ng251
2021-2-28 07:57:09

yes, I have the old version installed on a different laptop (windows 10 pro). maybe I’ll reinstall it tomorrow on this computer