
@nma.arvydas.silanskas has joined the channel

Hi, do you know how can I disable tests for package I uploaded to https://pkgs.racket-lang.org/index.html ? I made a wrapper for a C lib, and when it tries to invoke tests (which are there none btw), it fails because it naturally cannot find a .so file

@nma.arvydas.silanskas Hi! There are usually multiple ways to do that: - You want some executable parts of your Racket files to NOT execute when running tests → Put that code inside a (module+ main <your code here>)
to prevent it from being executed by raco test
(which looks for a test
submodule) - You want a whole directory of your package to be left out → See https://docs.racket-lang.org/raco/test.html?q=.info#%28part._test-config-info%29

Oh, and third way: - You can make an empty (module+ test)
inside a module without tests

I think the most used in the wild is the third way : just define an empty test submodule. The main
submodule trick is useful only when you have a Racket file expected to be the entry point for your program, and should not be required
by other modules. Setting the code in a main
submodule will prevent both tests and imports from executing the code.

For example, I have a file that is called start.rkt
in one of my packages. It starts up a server when called. If I push that to the package repository, it will get executed, will fail at starting up a server (because the repository’s sandbox will prevent it) and then hang, timeout, and fail. By putting the content of my start script in a main
submodule, none of that happens and everyone’s happy :smile:

On the other hand, if I have a file that is just a regular module expected to be imported, but has no tests in it, I should create an empty (module+ test)
at the end of the file, to tell the raco tester that there’s nothing to see here.

@nma.arvydas.silanskas see also the same question that came up a few weeks ago: https://racket.slack.com/archives/C06V96CKX/p1561054954100700
The solution is to completely disable raco test
on package server, but not on regular raco test
(which is useful if you want to add tests later to your package) by checking the envvar PLT_PKG_BUILD_SERVICE
. That is, put (define test-omit-paths (if (getenv "PLT_PKG_BUILD_SERVICE") 'all '()))
in your info.rkt
. See an example here: https://github.com/emina/rosette/blob/master/info.rkt

wow very fast response thanks :slightly_smiling_face: I’ll check it when I’m gone home

@samth in preparation for the first-issue
tag, can we start tagging bugs? Maybe we could start by doing it automatically using: https://github.com/marketplace/issue-label-bot Are you able to get that installed in racket/racket

?

Another newbie question — I have a file that contains lines of strings that I’d like to treat as “just bytes”, but no matter how I seem to read the data, any string escapes seem to be processed. Consider a line containing d\"
- I like to be able to treat that as (bytes 100 92 34)
. I had expected a byte-string to be just that, but that must be an error on my behalf: > (bytes-length #"d\"")
2
> (bytes-length (bytes 100 92 34))
3

@stefan.kruger do you mean (bytes-length #"d\\\"")
?

There are only two bytes in your first example, the first is d
, the second is "
.

The \
is used to escape the "

This is required because the bytestring is itself delimited by "

Sure.

How do I read data between newlines in a file, and have it as (bytes …) leaving any backslashes etc as is?

read-bytes
?

is this not doing what you want?

Hmm. Not sure why I find this confusing. But reading around some more I came across in-bytes-lines
, which allowed me to do: (call-with-input-file "data/data.txt"
(λ (f)
(for/fold ([counter 0])
([line (in-bytes-lines f)])
(+ counter (bytes-length line)))))

which produced the result I was after.

is there video of Rebooting Racket ELS 2019 keynote by Matthew Flatt?

I’m pretty sure it wasn’t recorded

The upcoming ICFP variant (http://www.cs.utah.edu/plt/rkt-on-chez/) in August will be recorded, I assume.

thanks I forgot about ICFP/Scheme workshop sounds exciting. I’d love to see Solver-Aided Programming for All by Emina Torlak.

Solver-Aided Programming sounds exciting!



@jjwiseman set the channel purpose: General discussion about racket-lang. Invite others through https://racket-slack.herokuapp.com/.i t to. Thugs gcc

@jjwiseman the first part of the new channel purpose statement seems fine except for the very last few bits .i t to. Thugs gcc.
those don’t seem right to me

We are rather thuggish

Uh. I didn’t do that?

That’s very weird.

I was driving when slack sent a notification to my locked phone that I was mentioned here. It’s hard for me to imagine that it was any of my devices that did that, so I dunno.

@jjwiseman set the channel purpose: General discussion about racket-lang. Invite others through https://racket-slack.herokuapp.com/

(I’m in the mountains of New Hampshire with poor reception, sorry I couldn’t fix it earlier)

why (list? ' 'a)
is #t, and where can I read more on about it?


’’a is short for (quote (quote a)) so it evaluates to (quote a) which is a list.

@jjwiseman no worries, enjoy the whites

hmm interesting, but something that probably never should appear in proper code I suppose. If I were Scheme lecturer in uni or elsewhere, I’d def put this in the exam

@nma.arvydas.silanskas why? if it should never appear in proper code, I doubt it should appear in exam code

''x
can appear in metaprogramming contexts, where you want to create a program that uses quote

I often find it clearer to use (quote x)
explicitly in that case, but some of the complexity is the same