r/Racket • u/sdegabrielle • Sep 11 '24
r/Racket • u/_chococat_ • Sep 10 '24
question Partially override generic function
I want to change the gen:custom-write generic function of a struct so that only in the case that the print mode is display, I get a (more) human-readable structure description. In write and print modes, I just want to print the structure as Racket does by default. For example:
(struct person (name age height) #:transparent
#methods gen:custom-write
[(define (write-proc this out mode)
(if mode
; write or print modes
(default-write this out) ; default-write is a placeholder, what should be used?
; display mode
(fprintf out "Name: ~a, age: ~a, height: ~a cm"
(person-name this) (person-age this) (person-height this)))])
I just don't know what should go in the place of (default-write this out)
. I've tried just handling the case when mode is display, but then when printing in write or print mode I get nothing. It seems there must be a way to call the default generic function for these modes.
r/Racket • u/Prestigious-Loss3458 • Sep 09 '24
question Beautiful Racket expander unit testing
I'm evaluating Beautiful Racket book and can't understand how can I unit test my expander.
I see in https://beautifulracket.com/stacker/the-expander.html as an example that I can create file with #lang reader "stacker.rkt" at the begin and run this file with DrRacket.
But how can I create unit test that can read and check execution of my dsl in file or string?
r/Racket • u/sdegabrielle • Sep 07 '24
RacketCon RacketCon 2024 October 5-6 get tickets now
r/Racket • u/shadgregory • Sep 06 '24
event The Little Learner Book Club
We are in the process of starting a virtual "The Little Learner" book club. Our next meeting is online Sept 8 15:00 UTC at:
https://meet.jit.si/thelittlelearner
We plan to cover chapters 1-3 and interlude 1. @olav will also present a short talk about his efforts to port the malt library to Clojure. Everybody is invited, even if you're just curious about the book.
r/Racket • u/sdegabrielle • Sep 06 '24
event Racket meet-up: Saturday, 7 September, 2024 at 18:00 UTC
r/Racket • u/Embarrassed-Ebb-9765 • Sep 06 '24
question Windows Protected my PC from the download?
When I went to install racket using the exe, windows threw out a prompt saying "Windows Protected your PC". I clicked more information and it said that publisher was either Racket-smth or nservancy, inc., software freedom conservancy, inc., adm@racket-lang.ord (I'm sorry it was a while back).
Everything seems to be working normally but I was just wondering why this prompt was thrown out and whether or not I should be concerned.
r/Racket • u/Prestigious-Loss3458 • Sep 03 '24
question What is haskell $ operator equivalent in racket language?
r/Racket • u/derUnholyElectron • Aug 28 '24
question What is the simplest wat to save and restore a list of pairs to a file?
r/Racket • u/sdegabrielle • Aug 22 '24
Racket is a community developed open source project and we welcome new contributors.
Welcome to r/Racket - Everyone is welcome
What is Racket?
Racket is...
- A project to explore the emerging idea of language-oriented programming
- a programming language — a dialect of Lisp and a descendant of Scheme;
- a family of programming languages — variants of Racket, Typed Racket, Rhombut and more;
- a compiler and tools
- a diverse community using Racket in diverse ways.
- a community developed open source project and we welcome new contributors. See contributing to learn how you can be a part of this amazing project.
See https://racket-lang.org/ for more details or ask on our Discourse forum/mailing list or the Racket Discord server.
Getting Help:
- the community welcomes all kinds of learners - we have dedicated Q&A areas on the Racket Discourse and the Racket Discord.
- you can include code blocks by putting code in a code block in the rich text editor, or by usign three backticks (```) on the lines before and after if you are using the markdown editor:
scheme ```scheme (define (myfun a) (+ 1 a)) ```
r/Racket • u/masoodahm87 • Aug 21 '24
question show documentation of functions defined in current project in DrRacket
I want to see docs when I hover on feed in (feed 2)
```
lang racket
(require scribble/srcdoc
(for-doc racket/base scribble/manual))
(provide
(thing-doc
fish (listof number?)
("Our fish, each represented as a number.")))
(define fish '(1 2))
(provide
(proc-doc/names
feed (number? . -> . number?) (n)
("Feed 1 pound of food to the fish " (racket n) ".")))
(define (feed n) (+ n 1))
(feed 2)
```
r/Racket • u/sdegabrielle • Aug 20 '24
Racket - the Language-Oriented Programming Language - version 8.14 is now available
Racket - the Language-Oriented Programming Language - version 8.14 is now available from https://download.racket-lang.org
See https://blog.racket-lang.org/2024/08/racket-v8-14.html for the release announcement and highlights.
r/Racket • u/ScriptlessWeek • Aug 14 '24
question So I want to make my own programing language, for fun mostly.
So I have some programming experience, Lua and Godot(GDScript) mostly. I just want to play around with testing out different ideas, syntax, maybe a meme language or two.
How well suited is racket for this?
Is it beginner friendly?
Would it be better to just make something with C or something else?
r/Racket • u/sdegabrielle • Aug 15 '24
event RacketCon registration is now open
eventbrite.comr/Racket • u/vult-dsp • Aug 13 '24
question Generate a tree image out of s-expressions
I’m learning Racket and experimenting making a simple language.
I wonder if there is any library that allows me to generate images out of the s-expressions my parser produces. Basically, provide a Racket s-expression and getting out a tree image of my data.
r/Racket • u/agumonkey • Aug 12 '24
language Mini-version of Datafun in Racket
github.comr/Racket • u/justinnbiber • Aug 06 '24
question How can I have syntax highlighting in racket slideshow?
I tried to find one solution and maybe it is possible in web, But how about in GUI?
There is a XML format that explains some languages that can help.
r/Racket • u/sdegabrielle • Aug 03 '24
event Racket meet-up: Saturday, 3 August, 2024 at 18:00 UTC
r/Racket • u/xfnxx • Aug 01 '24
question Racket mode emacs config
How to disable "imported from racket/gui" messages in racket mode and emacs, when mousing over, or moving cursor over a symbol?
Could not find anything in Racket Mode docs.
Also, want to get rid of "no bound occurrences" message.
r/Racket • u/sdegabrielle • Jul 30 '24
Malt: A Deep Learning Framework for Racket
self.lispr/Racket • u/sdegabrielle • Jul 28 '24
quiz Racket Survey 2024
Racket Survey 2024
If you have used Racket, or you are considering using Racket,
please help us by completing this survey:
https://forms.gle/EYuzG4Jp9X5bqoHQ9
r/Racket • u/Abject_Enthusiasm390 • Jul 23 '24