
@lexi.lambda I also mean racket/date
, which doesn’t even have an equivalent of string->date

Should I make an issue on github for the partition thing? Or is it something non-trivial to solve properly.. I checked the repo and the relevant part looks like this: [partition
(-poly (a b) (cl->*
(-> (asym-pred b Univ (-PS (-is-type 0 a) -tt)) (-lst b) (-values (list (-lst a) (-lst b))))
(-> (-> a Univ) (-lst a) (-values (list (-lst a) (-lst a))))))]
And I’ve no idea what to make of that.

@zenspider Indeed, but given that racket/date
is essentially nonexistent, turning it into a good datetime API would essentially mean reimplementing gregor. So just use gregor! But maybe it should be more clearly advertised.

@hoshom I’ve only briefly thought about it, but I’m pretty sure it would be a non-trivial fix

Currently Typed Racket can see that the string?
predicate does indeed recognize strings, but it fails to completely capture the notion of “not a string” in a type, which would likely be necessary to support partition
completely. A possible workaround would be to use filter
twice (once with string?
and once with number?
).

@pnwamk I’m using the my-partition
function I wrote above, as a workaround, works out for me. Anyway, I suppose you’re right, but Typed Racket sure does seem like it can do the thing you’re talking about, like how it understands what to expect in the else
branch of a cond
expression when using union types.

@hoshom random notes: on the for/fold
function, there’s a #:result
keyword you can use to reverse the lists as the final step if you want to maintain order (see the docs) or you could use for/lists
. And yes, Typed Racket can reason about negative type information generally, but not within a single type currently. I’m not sure if that’s clear enough… I’m essentially saying you’re right it seems like it should but it just falls short (because it does not feature negation types I believe).

Yes, the #:result
keyword is super handy, I sorely missed that one before it was introduced. Back then I only used to do things like adventofcode in Racket.

(I added it because I was losing my mind doing it after so many for/fold
s, lol)

haha, thanks! :smile:

Anyway, maybe some day I’ll understand types, racket and typed racket well enough to contribute. Until then, I’ll keep bugging people here :blush:

Rather a kind lot, you people are.


Hey, I’m trying to write scribble documentation for a language, but the language can be used both as a #lang
and by (require)
. I tried using @defmodule and @defmodulelang, but I get an error saying tags are duplicated… I’d like to have a section of the doc about the #lang
usage, and one about the (require)
usage.

Any idea how to do that?

(I have a hard time understanding the documentation for defmodule & co)

@jerome.martin.dev most languages like that do use the #lang
version (see slideshow, racket/gui, etc)

@samth Then, is there a way to render the module block without redefining a module in scribble?

not sure what you mean

well, when you define a module with @defmodule, it renders a block showing (require module-name) package: package-name

I’d like to be able to show that again and again when I’m in a section of the documentation requiring that module

you might need the no-declare
versions


mmmh, I still get the issue if I use no-declare multiple times

I get “WARNING: collected information for key multiple times”

in slideshow, the modules are slightly different : @defmodulelang*/no-declare[(slideshow/widescreen)]
@defmodule*/no-declare[(slideshow/widescreen/base)]

in my case, they have exactly the same name

I almost got it to work by using @defmodule[@racketmodname[rilouworld/quest] #:no-declare #:packages ("rilouworld")]
but I still get something weird. It renders as: (require (racketmodname rilouworld/quest)) package: rilouworld
The inner expression is not interpreted :disappointed:

can you just put rilouworld/quest
there?

WARNING: collected information for key multiple times

:confused:

the no-declare argument looks like it’s not taken into account when specifying an actual module

the only way I get it to work is by using a “content-expr” (word from the doc: https://docs.racket-lang.org/scribble/doc-modules.html?q=no-decalre#%28form._%28%28lib._scribble%2Fmanual..rkt%29._defmodule%29%29)

The syntax usage looks really weird to me, because depending on the type of what you pass to the first argument, it behaves differently

Ok, I’m starting to think it’s not possible :disappointed:

Ok, I checked the output using the macro-stepper. It seems the macro is working fine, but the bug happens later on when trying to generate links

YES, I GOT IT!

I had to add #:link-target? #f
to prevent generating another link

:tada:

when doing raco pkg install
on a BSD system I’m getting SSL not available, check 'ssl-load-fail-reason
is there a way to access and print that variable in REPL without needing to run the internal mzssl.rkt
module directly? I was hoping the variable would be printed to the debug logger but am not finding anything in the logger’s output.

@abmclin Which version of Racket are you using?

Racket 7.2

Okay. Ought to be fine.

I’m thinking possible something is misconfigured on this FreeBSD system related to SSL but don’t have much to go on to figure out possible causes

The only similar error I find on Google, is: https://github.com/mbutterick/pollen/issues/52

Here the issue was “I have checked the difference between my previous working installation and the new one. I chose the wrong platform in the racket download page. I am in x86_64 and installed the i386 version. Re-installing the right one solves the issue.”

hmm, this Racket was installed from the ports

if it’s some version mismatch issue, might need to contact the port maintainer

I would try the official installer from: https://download.racket-lang.org/

Then if that works, contact the port maintainer.

But - full disclosure - I have never tried Racket on FreeBSD. Using the official installer have solved other problems in the past though.

just FYI there is no installer available for Unix variants, compile from source is the only possible option. I haven’t had this particular issue before though. The pollen issue page told me how to find ssl-load-fail-reason
and I see the problem is it’s not able to find libcrypto.so
and libcrypto.so.5
is the installed version on this system. Hmm wondering if adding a symlink for libcrypto.so
will resolve it

@abmclin it’s possible that this is a new error because we just made https unconditional (as in earlier today)

The compile from source with prebuilt packages is the one I am thinking of.

oh that could explain why this error is only now just popping up


if you can comment there that would be helpful

(That’s why I asked about the version number)

Does anyone know how shared
interacts with typed/racket? I need to make this kind of an expression work: #lang typed/racket
(struct Foo ([a : Number]
[b : Foo])
#:mutable #:transparent)
(shared ([#{a : Foo} (Foo 1 b)]
[#{b : Foo} (Foo 2 a)])
a)