sorawee
2019-7-16 07:39:38

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


notjack
2019-7-16 08:24:43

wow, that was some impressive emojification


pocmatos
2019-7-16 09:05:41

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.


pocmatos
2019-7-16 09:09:48

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.


mflatt
2019-7-16 12:23:14

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.


pocmatos
2019-7-16 13:10:16

@mflatt works beautifully.


alexknauth
2019-7-16 13:40:34

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?


ryanc
2019-7-16 13:54:45

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.


nma.arvydas.silanskas
2019-7-16 17:06:01

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


soegaard2
2019-7-16 17:12:08

@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.


notjack
2019-7-16 17:22:27

nma.arvydas.silanskas
2019-7-16 17:24:15

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?


notjack
2019-7-16 17:26:11

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


notjack
2019-7-16 17:27:41

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


nma.arvydas.silanskas
2019-7-16 17:38:05

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


notjack
2019-7-16 17:42:50

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


notjack
2019-7-16 17:43:43

nma.arvydas.silanskas
2019-7-16 18:38:43

can someone comment on the haskell part though?


sergi.mansilla
2019-7-16 21:14:54

@sergi.mansilla has joined the channel


philip.mcgrath
2019-7-16 21:20:08

@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.


samdphillips
2019-7-17 04:46:24

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


kokou.afidegnon
2019-7-17 05:31:32

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


kokou.afidegnon
2019-7-17 05:31:39

waht is supposed to be the result ?


kokou.afidegnon
2019-7-17 05:31:54

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


sydney.lambda
2019-7-17 05:36:10

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 ’().


sydney.lambda
2019-7-17 05:38:05

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


sydney.lambda
2019-7-17 05:38:22

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


kokou.afidegnon
2019-7-17 05:39:36

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


sydney.lambda
2019-7-17 05:39:51

exactly :slightly_smiling_face:


kokou.afidegnon
2019-7-17 05:39:59

ok, thanks, :slightly_smiling_face:


sydney.lambda
2019-7-17 05:40:16

no problem.


kokou.afidegnon
2019-7-17 05:40:31

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


kokou.afidegnon
2019-7-17 05:40:50

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


kokou.afidegnon
2019-7-17 05:40:57

when do we use recursion?


kokou.afidegnon
2019-7-17 05:41:19

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


sydney.lambda
2019-7-17 05:41:45

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