
@orfeaskar has joined the channel

hello! happy to be here

Hi

I have a somewhat vague question: is there a project related to modal logic and behavior driven testing?

Don’t know.

Searching for “modal” on http://pkgs.racket-lang.org\|pkgs.racket-lang.org gives no results.

Here are the result for “logic”:


I think MiniKanren, Datalog and Parenlog are the the most “logic” related.

But I don’t know whether they are suitable for modal logic.

minikanren seems interesting

cannot find this datalog you mention

thanks


datalog may be useful for behavior testing

if you define some sort of test case database

The MiniKanren website has lots of useful resources:


Including links to papers and screen casts.

@orfeaskar What exactly is “behavior testing” and what makes it different from, say, the way rackunit
tests?


well it’s a current trend in system-level testing. Basically you have some workflows in your business that go through all kinds of systems

such as a customer requesting a package that has to be bundled together

and the end result is not in terms of just output of the workflow but also in terms of side-effects

you want to deliver the package but in a specific manner


this is one implementation, in Ruby I think

thanks for the explanation

i hope it was helpful

for example, it may be that your package needs to be authorized by an identity server

a behavior test would be that the package will eventually be authorized if it is valid

but it will be necessarily the case so

i will try to do it myself, after all this is the point of racket - extensibility

@mflatt where do tests for struct
/define-struct
/struct-copy
locate?

“pkgs/racket-test-core/tests/racket/struct.rktl”

Thanks! I was looking at pkgs/racket-test
, so I couldn’t find it

@mflatt there’re struct-copy1
and struct-copy2
. What do these mean? https://github.com/racket/racket/blob/master/pkgs/racket-test-core/tests/racket/struct.rktl#L1055

If I add a new one, should I name it struct-copy3
?

A test in the core test suite is either (test <expected> <proc-expr> <arg-expr> ...)
or (test <expected> <non-proc-label-expr> <expr>)
. So 'struct-copy1
and 'struct-copy2
are just labels for the test.

Right, but shouldn’t the labels be all different?

I see a lot of struct-copy2

The labels just need to be distinct enough that a failure can be racked back to a test.

So, probably the expected result or surrounding tests can distinguish 'struct-copy2
tests. Or it has been good enough so far, at least.

I see. Thanks

Sorry for a lot of questions. This should be the last one. Can I use (module xxx racket/base ...)
in the test file (.rktl
), and if not, what should I do instead?

Yes, you can write a module
form. Pick a long name for the module so that it’s unlikely to conflict with any other module declaration in the tests.

I’ve got an unusual packaging question

I maintain a Racket package (herbie
) and I’d like to have a plugin system of sorts for it

So that you could install another package (like softposit-rkt
) and it could somehow notify the herbie
package that it should load special support for it

@pavpanchekha You could probably use setup/getinfo
to communicate information via info.rkt
files. https://docs.racket-lang.org/raco/getinfo.html

Could you give a little more detail on how I’d set it up?

It’s how DrRacket’s plugin system works, for example: it looks for info.rkt
keys named drracket-tools
, drracket-tool-names
, drracket-tool-icons
, and drracket-tool-urls
, as documented here. https://docs.racket-lang.org/tools/implementing-tools.html

Using setup/getinfo
, you can choose your own key(s), like herbie-plugins
or something like that, then call (find-relevant-directories 'herbie-plugins)
to find info.rkt
files that define that key.

So I’d use find-relevant-directories
to search for a herbie-plugin
key or whatever, then use get-info
to read out the name of the module to load, and then dynamic-require
it?

ha you beat me to it

Right, exactly.

Excellent, thank you so much

This is fantastic!

Good luck—I’ve never actually done anything like that, so I am mostly just guessing here. :)

Well, one of the most important things you told me is that DrRacket has a plugin system, and I can always read its source code to understand how it works

Yeah, that’s what I was mostly basing my suggestion off of, though I don’t know how complex the DrRacket code actually is that handles plugin loading.

Awesome, well, thanks so much for the help!

@ararslan has joined the channel

@pavpanchekha you might also look at how raco commands work, which is a little simpler than DrRacket but works basically the same way

Is there any way to ask Racket to make a gl-context<%>
that uses OpenGL 3.3?

Ah, nevermind, it’s the set-legacy?
method of gl-config%
.