
@lexi.lambda Megaparsack is cool

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

let’s assume no keyword arguments to begin with.

I suppose this happens a lot when macroexpanding wrappers

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

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

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

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”)?

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

is there a general bug tracker for Racket?

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.


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

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

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

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

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

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.

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…

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.

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.

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

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

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

@cadr What would that do?

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

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

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

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

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

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

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

that is what I’m suggesting

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

no, they end up there

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

no, the compiled output works fine

try it out :slightly_smiling_face:

@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

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

but paths can be

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

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

I’m not sure

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

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

and those marshal just fine

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

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

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

Trying to diagnose an issue on Windows Racket

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

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

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

@cadr I think i need a little more information

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

or are you actually calling dynamic-require
?

or something else?

No, not dynamic-require

Using a macro with in-directory

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

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

foo
and foo*

or foo/bar

foo%
denotes a class

thanks.

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

no

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

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

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

is # here special syntax or just another character?

are signatures and units still used much?

#%foo
is just a symbol

a little but not much

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.

(hence asking about foo* as a variant)

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

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.

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

-foo
is usually “the local foo
”

so as to avoid confusion

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

for more variants use foo/bar

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