mihaidobri
2020-10-19 08:16:13

Can you elaborate a little on this , what exactly you mean by “check reverse of the inputs” ?


mihaidobri
2020-10-19 08:30:13

Actually I think I manged to solve the “bug” by removing all “reverse commands”


kellysmith12.21
2020-10-19 09:21:46

Is foo/bar considered a different collection from foo or is it considered a subcollection?


laurent.orseau
2020-10-19 09:22:32

it depends :slightly_smiling_face:


laurent.orseau
2020-10-19 09:23:58

I take it that by “subcollection” you mean some modules that can’t really be used on their own, and only make sense with the rest of the foo collection.


laurent.orseau
2020-10-19 09:25:34

In that case, racket/string can be used independently of racket/list, say, so they are two different collections.


laurent.orseau
2020-10-19 09:27:33

metapict/crop on the other hand doesn’t make sense on its own, and is really meant to be used as part of metapict


kellysmith12.21
2020-10-19 09:35:25

Ah, ok. That clears things up.


soegaard2
2020-10-19 09:36:50

So the list (0) represents the polynomial 0, which has degree -infinity ? Or does the list () represent 0?


mihaidobri
2020-10-19 10:05:04

From 1 to 10 , how bad is if I use the “else” inside of a “cond” ? (like I used in the code from above ) ?


laurent.orseau
2020-10-19 10:05:53

Why would it be bad?


mihaidobri
2020-10-19 10:08:08

i read the Racket documentation and I could not fully understand the “else” syntax exmplanation


mihaidobri
2020-10-19 10:08:38

and I googled so I found “by adding an else clause, you are telling Racket that it is okay to turn off error-checking.You are assuming the burden of error-checking yourself! Therefore, we strongly recommend against using an else case in your cond expressions” https://cs.brown.edu/courses/cs017/content/docs/racket-style.pdf


mihaidobri
2020-10-19 10:10:50

Actually I thought Scheme has an “else” statement, and Racket does not, this was my first confusion


laurent.orseau
2020-10-19 10:12:56

Ah, if you’re a student and/or are beginning in programming, then yes, it’s probably better to write all the conditions and not use else. But to be honest, once the programmer understands clearly what they’re doing, they always use an else.


mihaidobri
2020-10-19 10:13:52

okay, thank you so much for your reply!


mihaidobri
2020-10-19 10:49:12

My next question is related to the poly-add code I shared above. I want to do ( run "+ var 5" ) ; expected “1x +5”


mihaidobri
2020-10-19 10:49:41

but I get :; +: contract violation ; expected: number? ; given: '(0 1) ; argument position: 1st ; [,bt for context]


mihaidobri
2020-10-19 10:51:11

Could anybody please give me a hint? I feel that is a “mismatch” between the number and the “given ’(0 1”) ", but I am not sure where to trace the issue


mihaidobri
2020-10-19 10:57:29

I mean, since my function “poly-add” has 2 lists as arguments, and is working fine when i add two polynomial as lists, how do I have to handle this case when i have to do ( run "+ var 5") , where “var” is like an “x”


sorawee
2020-10-19 11:07:07

What does the function run do?


mihaidobri
2020-10-19 11:12:04

this information was not provided


aymano.osman
2020-10-19 13:43:28

What is the best way to define an alias for a macro?

Does something like (define-syntax-alias alias macro) exist?


mflatt
2020-10-19 13:48:16

(define-syntax alias (make-rename-transformer #'macro))


quincbj5
2020-10-19 14:15:32

@quincbj5 has joined the channel


attilasedon1
2020-10-19 15:09:45

@attilasedon1 has joined the channel


aymano.osman
2020-10-19 17:41:38

woot! :parrot:

Thank you


aymano.osman
2020-10-19 18:43:33

Does a formatter for Racket code exist? DrRacket lets you indent the whole file with “Reindent all”, which is very nice. It would be nice to expose that as a command line utility.


aymano.osman
2020-10-19 19:04:50

#lang racket (require framework) (define t (new racket:text%)) (send t set-filename "/tmp/foo.rkt") (send t load-file) (send t tabify-all) (send t save-file) The above seems to work, but I’m not sure if it’s the right approach.


laurent.orseau
2020-10-19 20:32:32

Nice. The dependency on framework is overkill. Maybe look at how tabify all is implemented.


aymano.osman
2020-10-19 20:55:36

I agree. Will look into it.


kellysmith12.21
2020-10-20 02:39:33

Is there a standard macro/option to make lazy struct fields, or should I just manually wrap field values in promises?


mwblakley
2020-10-20 05:31:55

@mwblakley has left the channel