
@rokitna how many emoji combinations can you represent a number n? :stuck_out_tongue:

wow, that was some impressive emojification

Does anybody know why raco pkg install
can’t find compiler-lib
in local /root/racket/pkgs
catalog? For example: # raco pkg install --no-setup --catalog /root/racket/pkgs compiler-lib
raco pkg install: cannot find package on catalogs
package: compiler-lib
By the way, this is a docker container, that’s why it is running as root.

The idea here is that I am compiling racket standalone using the ./configure && make
lines in racket/racket/src
and I want installation to pick up local packages first before trying to download them. However, I noticed that if I add file:///root/racket/pkgs
to the catalog, it doesn’t seem to work. Therefore I ended up trying the interaction above.

The “pkgs” directory has package sources, but you want a catalog that points to those sources. You can use create-dirs-catalog
from pkg/dirs-catalog
to build a catalog that points to a directory of package sources.

@mflatt works beautifully.

3D syntax should be okay as long as it never gets passed down through the macro expander or tries to cross phases, right? If it only gets passed to template-metafunctions and the template-metafunctions always force them before returning them as output it should be fine?

In a narrow sense of “okay”, yes. (In fact, I don’t think crossing phases per se is a problem in that sense.) But from another perspective, 3D syntax is just a bug that it is impractical to fix. So I don’t want to add a feature to core Racket that depends on it.

Hello, I’ve been using racket for two years or so. How important is knowing the reader macro, aka making custom lang? The ones I’ve used — namely at-exp and typed/racket — are very ambitious. Is reader macro suitable choice for much smaller tasks (the kind that syntax-rules could easily solve)?
Another question — what is the practical difference between Haskell type system and Typed Racket? What (if any) are concrete examples of things that are easy to do in Haskell, but hard or impossible in Typed Racket (only talking about types; monads, lazy/strict are out of scope)? (for the context, I know very little about Haskell). I know this is… slightly unreasonable to ask about disadvantages of language in a forum dedicated to it, but I’ve not been able to find answer elsewhere

@nma.arvydas.silanskas Just making sure I get the question. There is something in Racket called “reader macros”, (see section 13.7.1 on readtables in the Reference). They are not important in the sense that they are seldom needed. But if you need to change the lexical syntax in an otherwise standard Racket file, then they do become important. And they have nothing to do with syntax-rules.
They are not needed to create a new custom language though.
If you want to learn about making custom language, then at-exp and typed/racket might might not be the best place to start (as you hint at). Try instead reading Beatiful Racket.


I suppose a more clear phrasing would be this: if I can, should I always be using syntax macro over reader macro (the same way I would always use normal function instead of syntax macro if I can)? OR are the syntax macros and reader macros so to say on the same level with each other?

I would say prefer regular macros to reader macros when possible, yes

And prefer using syntax-parse
and define-simple-macro
over syntax-rules
, syntax-case
, and define-syntax-rule

hmm interesting, haven’t stumbled upon syntax-parse before. Seems it’s not a racket primitive, but some sort of library

Yes, it’s a library built on top of rackets base macro system


can someone comment on the haskell part though?

@sergi.mansilla has joined the channel

@nma.arvydas.silanskas I’m not the most qualified person to answer, but Typed Racket and Haskell have very different goals, and thus make different trade-offs in the design of their type systems. TR wants to make a smooth path to adding types to your #lang racket
programs, so it has put effort into type system features like “occurrence typing” that let it check idiomatic dynamically-typed code. Haskell expects you to design your code with types in mind, so it puts its effort into different features, like type classes.

Bad week for me to take a mini Racket vacation :slightly_smiling_face:

can anyone please ex[plain? (cons 4 '())

waht is supposed to be the result ?

using DrRacket i m having the same output i m a bit confused

it should produce ’(4), that is, a list containing just the number 4. Consing the empty list ’() onto the end is what wraps the 4 up into a list. Or, you can think of it as a list who’s car (first) is 4, and who’s cdr (rest) is the empty list ’().

these “box and pointer” diagrams can help: https://berkeley-cs61as.github.io/static/04_list_123.png

that would be (cons 1 (cons 2 (cons 3 ’())))

so if i understand, down pointed arror is CAR and -> is CDR, right ?

exactly :slightly_smiling_face:

ok, thanks, :slightly_smiling_face:

no problem.

on the second note, currently reading htdp and trying to assimilate as much as possible,

but along the line i noticed recursion is often used here, which is seems to be foggy for me,

when do we use recursion?

let’s say recursion vs iteration, when do we use them?

they can both serve the same purpose, when you want to do something repeatedly.