5CYTH3 / karm_parser

A parser / maybe compiler that I am proud of
1 stars 2 forks source link

Why are the parameters in LamDef and LamCall optional? #24

Closed RHL120 closed 6 months ago

RHL120 commented 7 months ago

The LamDef and LamCall variants of the Expr enum (defined in src/parser.rs) have a common field: params: Option<Vec<String>>. I have been wondering why this field has to be optional. Can't a value of [] be used instead of None to represent a function with no arguments?

5CYTH3 commented 6 months ago

Now it is obsolete as in the previous versions, were developed under an older version of rustc and I had to easily pattern-match on slices, and doing so was the easiest way. With the new syntax introduced recently, we can get rid of this part of the code (I will take care of that this afternoon).

RHL120 commented 6 months ago

Cool, I can do it if you do not have enough time.

RHL120 commented 6 months ago

I have a favor to ask from your. I hope you don't find this inappropriate but I am thinking about joining an MP2I next year and I was wondering if we can chat on Telegram or a similar tool because I have a couple of questions about it.

5CYTH3 commented 6 months ago

I have a favor to ask from your. I hope you don't find this inappropriate but I am thinking about joining an MP2I next year and I was wondering if we can chat on Telegram or a similar tool because I have a couple of questions about it.

No worries mate, I don't use telegram often, I don't know what type of other social media you use.

5CYTH3 commented 6 months ago

The problem is solved, please reopen a separate issue for what we've discussed

RHL120 commented 6 months ago

I have a favor to ask from your. I hope you don't find this inappropriate but I am thinking about joining an MP2I next year and I was wondering if we can chat on Telegram or a similar tool because I have a couple of questions about it.

No worries mate, I don't use telegram often, I don't know what type of other social media you use.

Thanks for your help. I am not on any other social media platform. We can share our phone numbers over e-mail (so as to chat using Whatsapp or SMS) if you would like.