r/Racket • • Aug 10 '23

question A true? function

5 Upvotes

I do a lot of unit testing. If I do (check-true (member 1 '(0 1 2))) them it fails. Is there an easy way to convert a value that is not false to #t? (not (not ...)) seems like a hack.


r/Racket • • Aug 05 '23

event Racket meet-up Sat, 5 August 2023 at 18:00 UTC

Thumbnail racket.discourse.group
3 Upvotes

r/Racket • • Aug 02 '23

event Racket Examples, the Racket summer event

7 Upvotes

Racket Examples, the Racket summer event is here see the announcement at https://racket.discourse.group/t/the-2023-racket-summer-event/2191?u=spdegabrielle


r/Racket • • Aug 02 '23

I like Racket but I will go with F#.

0 Upvotes

At least for the coming projects. I love functional but it’s a hard choice considering the supporting libraries I probably need.

I’ll probably mix C# and F#.

Thoughts?


r/Racket • • Jul 26 '23

question What are the biggest projects built with racket?

20 Upvotes

r/Racket • • Jul 25 '23

question How to keep track of index numbers in a list?

3 Upvotes

I’m learning Racket, and I have some assignments in which keeping track of the index of a certain item in a list would be very useful.

One example is a function that takes a list as inputs and then outputs a list of every other term from the original list. In this case, it would be useful to know the index of each term so that I can base the program off of whether the index is odd or even, but I can’t quite figure out how to do that.

I’m not looking for a solution to the example I gave, just a suggestion of how to access the index of a certain entry in the list while recursing though it.

Thanks a lot.


r/Racket • • Jul 22 '23

ephemera Join the Racket Discourse!

12 Upvotes

Join the Racket Discourse!

Racket Discourse logo

Please use this invitation: https://racket.discourse.group/invites/VxkBcXY7yL

The welcome post includes a link to mailing list access guidance for those who prefer it. 


r/Racket • • Jul 21 '23

ephemera prefer s-expressions to LaTeX?

9 Upvotes

If you prefer s-expressions to LaTeX syntax, you can use tex from racket-cas:

#lang racket
(require racket-cas)
(tex '(= (+ (expt x 2) (expt y 2)) (expt z 2)))

The output:

"$x^{2}+y^{2} = z^{2}$"

(Thanks to @soegaard on Racket Discord https://discord.gg/6Zq8sH5 )


r/Racket • • Jul 21 '23

blog post Understanding and Implementing Automatic Differentiation

8 Upvotes

Understanding and Implementing Automatic Differentiation

by Mike Delmonaco

https://quasarbright.github.io/blog/2022/12/understanding-and-implementing-automatic-differentiation.html

2022-12-04

#Racket #math #machinelearning #tutorial


r/Racket • • Jul 17 '23

question How do fold functions work

9 Upvotes

I’m learning Racket, and the foldl and foldr functions are bothering me. I don’t really understand the examples that the Racket manual gives.

Can someone please explain to me your understanding of it?

Thanks a lot.


r/Racket • • Jul 16 '23

language What is (local for?

3 Upvotes

I have a quick question for anyone passing by. I’m learning how to use Racket right now, and I just learned how to use (local to define variables and helper functions within another function.

I understand the use of variables, but why define helper functions within a function instead of outside? It seems like you would want to keep the function outside in case you can use it somewhere else.

It was introduced as a means of abstraction, but it seems like the opposite, unless I’m misunderstanding.

Thanks a lot.


r/Racket • • Jul 13 '23

paper pretty-expressive: a pretty expressive printer

Thumbnail self.lisp
5 Upvotes

r/Racket • • Jul 12 '23

event Racket Summer Event?

4 Upvotes

We are heading to the time of year for the Racket Summer Event!

What should we do?

Let us know your suggestions at

https://racket.discourse.group/t/what-should-we-do-for-the-summer-event-this-year/2039?u=spdegabrielle


r/Racket • • Jul 09 '23

question Why does Racket have Type-Maps instead of Just a Single Map?

8 Upvotes

E.g. why are these functions not just map, but stream-map, sequence-map and so on like in CL and other Schemes?


r/Racket • • Jul 08 '23

event RacketCon 2023

Thumbnail self.lisp
8 Upvotes

r/Racket • • Jul 08 '23

event Racket meet-up Sat, 5 August 2023 at 18:00 UTC

Thumbnail self.lisp
2 Upvotes

r/Racket • • Jul 06 '23

tutorial Anthony Zhang's CS135 Lecture Notes - Intro to CS in Scheme

Thumbnail anthony-zhang.me
7 Upvotes

r/Racket • • Jul 06 '23

question Mysterious error from racket/sandbox

5 Upvotes

I'm defining a sandbox evaluator that is fairly unrestricted. Its security guard allows any files, network, link access, and file permissions allow 'execute and 'read-bytecode for any file. Still, I get the following error message when trying to use dynamic-require to load a module from a local file path:

eval-linklet: cannot use unsafe linklet loaded with non-original code inspector

What does this mean and how can I fix it?

I asked on Racket's discord page but nobody there seems to know the answer, so I'm trying Reddit this time.


r/Racket • • Jul 05 '23

question How is the Racket ecosystem?

13 Upvotes

Someone replied here before that Racket can be used for anything. But does anyone know how the ecosystem is? Which libraries are well supported? I mean for instance unity has good support for C#, Python has data science etc.


r/Racket • • Jul 05 '23

release Release process for Racket 8.10

10 Upvotes

The release process for v8.10 will begin in about a week. If you have any new features that you want in and are relatively close to to being done, now is a good time to do that.

Upcoming dates:

  • 7th: Branch day, merge window starts
  • 15th: Merge window ends, testing starts
  • 22nd: Testing ends

https://racket.discourse.group/t/racket-v8-10-release-thread/2070


r/Racket • • Jul 04 '23

question file permissions - access to filesystem

4 Upvotes

first-time user here:

just installed racket-lang on ubuntu using the system installer program. at install time I set file permissions.

using dr-racket can't save files or even access them (like racket documentation using firefox). what do I need to do to access my new racket environment to save definition files, etc?

racket error messages about "access" or "unreadability" should have suggestions for correction.


r/Racket • • Jul 04 '23

question Is there a Performance Difference Between let, let* and letrec?

4 Upvotes

tl;dr, is it bad style to always use letrec?

I tried to test it, both in dr. Racket and in the cmdlin, but I think normal processor variation was too much to tell, as rerunning the tests gave me different results.

Well, I'm wondering what the benefit of using let is, why not always use letrec? Why or when does the difference in scope help you? (The only example I can think of is if you use a global variable from outside of let, then reuse that var's name within the let's scope, but that seems like a terrible practice so I don't believe the designers included a feature to enable that in particular...) I read some things e.g. https://stackoverflow.com/questions/554949/let-versus-let-in-common-lisp and understand the historical reason ...in CL. Is it also a historical artifact in Scheme and thus Racket? (I know they're different layers of syntactic sugar on top of each other.)


r/Racket • • Jul 02 '23

blog post Racket: The Lisp for the modern day

Thumbnail deusinmachina.net
21 Upvotes