notjack
2017-1-13 08:39:19

@lexi.lambda Megaparsack is cool


fahree
2017-1-13 12:31:49

silly questions. What’s the correct way to extract the list of arguments from a formals list to create a chained function call?


fahree
2017-1-13 12:32:05

let’s assume no keyword arguments to begin with.


fahree
2017-1-13 12:41:19

I suppose this happens a lot when macroexpanding wrappers


mflatt
2017-1-13 12:42:55

@fahree Is syntax/parse/lib/function-header on the right track?


fahree
2017-1-13 12:44:53

probably! Thanks… and now I have to actually learn how to use syntax/parse :slightly_smiling_face:


fahree
2017-1-13 12:45:16

and I thought that “porting” acmsmall to support acmart would be a trivial project…


fahree
2017-1-13 12:50:53

next silly question: drracket shows an error, but the error isn’t clickable, I have to go find a button far to the right “Jump to Error” — can the error itself be made clickable instead (maybe with a help bubble “Jump to Error”)?


fahree
2017-1-13 12:53:09

and where is the proper suggestion box for small issues like that?


fahree
2017-1-13 12:53:18

is there a general bug tracker for Racket?


fahree
2017-1-13 12:54:25

That could be a fun thing to introduce students to: “pick a bug in the bug tracker, and solve it”. They say that academics are not paid to maintain old code, but they also say that students work for no pay.


mflatt
2017-1-13 12:55:57

fahree
2017-1-13 13:08:52

oh, ok. Sorry, I filed something against http://bugs.racket-lang.org\|bugs.racket-lang.org — is that place not appropriate anymore? http://bugs.racket-lang.org/query/?cmd=view&pr=15394


fahree
2017-1-13 13:10:34

oh, while I have you — what is the proper way to issue different output depending on the backend being latex vs html?


fahree
2017-1-13 13:11:40

I see cond-element and cond-block in scriblib/render-cond


fahree
2017-1-13 13:12:18

They don’t seem to be a super-friendly interface. Happily there are only two “types” involved (element vs block).


mflatt
2017-1-13 13:24:14

GitHub issues is better than http://bugs.racket-lang.org\|bugs.racket-lang.org, but the latter is ok


mflatt
2017-1-13 13:26:05

To be honest, I forgot that cond-element and cond-block exist. My strategy is generally to push any backend configuration into Latex macros and CSS/JS. That’s rarely convenient, but it tends to compose the best.


fahree
2017-1-13 13:34:32

Well, there are cases where this doesn’t work well. Maybe I need to also learn to use CSS/JS to postprocess some ugliness in the output… and then instead of being a scheme programming exercise, it’s latex and css/js hell…


fahree
2017-1-13 13:35:19

stupid things like: lack of spaces in the html, so it displays ugly in w3m — maybe the css can fix that, but it’s too late for w3m.


fahree
2017-1-13 13:39:53

not sure why there couldn’t be a unique cond-content instead of cond-block and cond-element, that force me to double all my conditional infrastructure on top.


fahree
2017-1-13 13:40:43

I’m also not sure how to deal with \title and \subtitle arguments.


lexi.lambda
2017-1-13 18:39:26

@notjack: glad to be of service. :) though I have to ask, what about net/url wasn’t good enough for you?


cadr
2017-1-13 19:18:26

Is there a function to convert paths between Windows and Unix?


samth
2017-1-13 19:20:57

@cadr What would that do?


cadr
2017-1-13 19:22:53

@samth convert “foo\bar” to “foo/bar” basically but I don’t wanted to immediately jump to string replace to do that


notjack
2017-1-13 19:43:52

@lexi.lambda it made some scheme-specific assumptions that got in the way of what I wanted to do


leafac
2017-1-13 19:43:55

I guess string replace would be incorrect, as directory and file names may contain “/”.


samth
2017-1-13 19:44:32

@cadr what kind of paths do you want to work on?


cadr
2017-1-13 19:45:58

I want to work on Unix-style paths. Windows paths don’t appear to work in (require …)


samth
2017-1-13 19:46:48

if you’re generating uses of require, then you can just use path values


lexi.lambda
2017-1-13 19:49:28

@samth: wouldn’t that be 3d syntax…? or are you suggesting something different from how I interpreted that suggestion?


samth
2017-1-13 19:49:45

that is what I’m suggesting


lexi.lambda
2017-1-13 19:50:25

ah, hmm. is require alright with 3d syntax because the paths won’t end up in the fully expanded module?


samth
2017-1-13 19:50:46

no, they end up there


lexi.lambda
2017-1-13 19:51:03

then wouldn’t that prevent the module from being compiled? :/


samth
2017-1-13 19:51:18

no, the compiled output works fine


samth
2017-1-13 19:51:22

try it out :slightly_smiling_face:


lexi.lambda
2017-1-13 19:54:26

@samth: wait, now I’m confused, why does that work? I assumed the “write: cannot marshal value that is embedded in compiled code” error got triggered for any arbitrary piece of 3d syntax but now I see that is not the case


samth
2017-1-13 19:55:01

you only get that for things that can’t be marshalled (sort of tautologically)


samth
2017-1-13 19:55:05

but paths can be


lexi.lambda
2017-1-13 19:55:54

also apparently I just discovered that primitive functions can be? that seems weird


lexi.lambda
2017-1-13 19:56:13

is the list of things that can be marshaled documented anywhere?


samth
2017-1-13 19:57:28

I’m not sure


lexi.lambda
2017-1-13 19:58:37

just when I think I’m starting to understand how Racket works under the hood you throw these things at me :)


samth
2017-1-13 19:59:23

think about it this way: syntax objects contain paths in them (for source locations etc)


samth
2017-1-13 19:59:31

and those marshal just fine


lexi.lambda
2017-1-13 20:00:00

yeah, I suppose that makes sense, though the fact that I can marshal (datum->syntax #f add1) is odd


cadr
2017-1-13 20:27:49

@samth so ok, this is the first time that I hear about the 3d-syntax, I think I get what it is but still am not sure how can I use a path value in require, should I just create a macro for it, or?


samth
2017-1-13 20:28:10

@cadr can you explain what you’re trying to do?


cadr
2017-1-13 20:28:51

Trying to diagnose an issue on Windows Racket


cadr
2017-1-13 20:29:44

In particular, some paths are being given by (in-directory) already have backslashes for path separators


cadr
2017-1-13 20:30:27

So trying to pass them to (require …) is an issue, since the paths with backslashes are rejected


cadr
2017-1-13 20:30:55

I’m not sure where the bug is in this pipeline


samth
2017-1-13 20:31:19

@cadr I think i need a little more information


samth
2017-1-13 20:31:34

are you generating a use of require with a macro that uses in-directory?


samth
2017-1-13 20:31:48

or are you actually calling dynamic-require?


samth
2017-1-13 20:31:54

or something else?


cadr
2017-1-13 20:32:16

No, not dynamic-require


cadr
2017-1-13 20:32:31

Using a macro with in-directory


samth
2017-1-13 20:37:44

@cadr you might want (require (file ...))


fahree
2017-1-14 05:36:22

Is there an established convention for variants of a function? Say foo and foo* or foo and foo% or foo and foo/bar ?


samth
2017-1-14 05:41:36

foo and foo*


samth
2017-1-14 05:41:43

or foo/bar


samth
2017-1-14 05:41:51

foo% denotes a class


fahree
2017-1-14 05:44:40

thanks.


fahree
2017-1-14 05:45:01

In Common Lisp, a class is <foo> — does <foo> mean something in racket?


samth
2017-1-14 05:45:27

no


fahree
2017-1-14 05:45:56

(except in my interface library, where <foo> is the interface and >foo< is the class, when the interface defines a type)


samth
2017-1-14 05:46:27

other conventions to know — #%foo is an internal thing that is automatically inserted, foo&lt;%&gt; is an interface, Foo is a type, foo/c is a contract, foo^ is a signature, foo@ is a unit


fahree
2017-1-14 05:46:36

(well, many Lisp programs don’t have any special convention for classes, either)


fahree
2017-1-14 05:47:03

is # here special syntax or just another character?


fahree
2017-1-14 05:47:27

are signatures and units still used much?


samth
2017-1-14 05:47:37

#%foo is just a symbol


samth
2017-1-14 05:48:17

a little but not much


fahree
2017-1-14 05:49:29

eschews learning syntax/parse for now and tries to cut through it by defining several variants of syntax rather than a set of macros that do the right thing — but I’d like to come back to syntax/parse later.


fahree
2017-1-14 05:49:43

(hence asking about foo* as a variant)


fahree
2017-1-14 05:49:55

When there are more than two variants, is there a convention?


fahree
2017-1-14 05:51:11

e.g. prolog has foo/2 foo/3 to name arities (though it’s special syntax there) Some Lisp libraries use reduce/+ reduce/strcat reduce/foo as variants, for instance.


fahree
2017-1-14 05:52:47

I see prependings of - or — in front of #%module-begin when defining a language.


samth
2017-1-14 05:54:16

-foo is usually “the local foo


samth
2017-1-14 05:54:26

so as to avoid confusion


samth
2017-1-14 05:54:45

foo** or foo*** is only used in let*


samth
2017-1-14 05:55:00

for more variants use foo/bar


samth
2017-1-14 05:55:16

esp. if they have more identity than just “the other foo