

> ((string-len/c 4) "abcd")
#f
> ((string-len/c 4) "abc")
#t
Uh?
(string-len/c len) → flat-contract?
len : real?
Returns a flat contract that recognizes strings that have fewer than len characters.
But… why not equal?

The length is not a valid index.

Wait. Is string-len/c for the string or the index?

As the docs say, it’s to recognize strings of at most len characters

So it’s not about an index, but a length

Okay, that’s mysterious.

Maybe that’s why it is called string-len/ c
and not string-length/c
…

possibly, though that’s a strange behaviour. Also there’s no string-length/c

Here’s when it was originally added


It used to be named string/len

:wave: Having an issue with raco setup
and some deps, which is causing my CI runs in Github to fail :thread:

when I run raco setup --tidy --avoid-main --check-pkg-deps --unused-pkg-deps --pkgs paperplane
I get errors like these:
raco setup: found undeclared dependency:
raco setup: mode: run
raco setup: for package: "paperplane"
raco setup: on package: "gregor-lib"
raco setup: dependent source: /Users/yuzu/github/paperplane/private/compiled/logger_rkt.zo
raco setup: used module: (lib "gregor/main.rkt")
raco setup: found undeclared dependency:
raco setup: mode: run
raco setup: for package: "paperplane"
raco setup: on package: "rackunit-lib"
raco setup: dependent source: /Users/yuzu/github/paperplane/private/compiled/readmes_rkt.zo
raco setup: used module: (lib "rackunit/main.rkt")

Code compiles and runs fine, unsure what I need to add to info.rkt
or elsewhere to alleviate

this is on Racket 8.3 CS on macOS M1 silicon

do you have gregor-lib
in deps
?

and also rackunit-lib

yeah added them and that seems to have fixed. When did things switch to using rackunit-lib
over rackunit
?

(also not idea what compatability-lib
is but I neede that too)

rackunit
requires rackunit-lib

So if you type rackunit
, that would have worked too

It’s just that rackunit
also has other deps, like documentation, etc.

So some people want to avoid it, and use the actual core package (rackunit-lib) directly, to avoid bringing in more deps

allrighty

thanks for the help!

Note that the --fix-pkg-deps
option will just fix it for you

@cristhianmareccos2222 has joined the channel

Didn’t you ask the same question in Discord? I think @soegaard2 replied to you. Did you follow his advice?

Yes but i dont understand the point 1 and 3 of his post i made function for get the list but dont know how to return for example from verb to object and the function goes into all the list no only thats 1 i want