zenspider
2017-7-1 21:13:41

are there macro forms of IO that don’t take thunks? (iow, use expr ...) just feels klunky


zenspider
2017-7-1 21:15:01

also, I’m trying to do @mflatt’s suggestion of using input-port-append to prepend a #lang line … Will location info be for the concatenation or for each port being used? IE, will error info be off-by-one?


zenspider
2017-7-1 21:16:57

Hrm… actually:

UNKNOWN::0: read: #lang not enabled in the current context

zenspider
2017-7-1 21:17:38

… that must be from C? I can’t find it in the racket source


florence
2017-7-1 21:41:53

@zenspider #lang not enabled in the current context usually means you want with-module-reading-parameterization


zenspider
2017-7-1 21:45:43

looking… I used (read-accept-reader #t) and feel like I’m going down a rabbit hole


zenspider
2017-7-1 21:48:31

same rabbit hole:

dynamic-require: name is not provided
name: 'read
module: #<resolved-module-path:(submod "/Users/ryan/Work/git/zenspider/schemers/br/basic/main.rkt" reader)>

the only dynamic-require I use anywhere is for the colorer, which shouldn’t be invoked at this point


zenspider
2017-7-1 21:48:59

also, syntax/modred vs syntax/module-reader? :confused:


zenspider
2017-7-1 21:57:15

ok. Stole some code from https://github.com/AlexKnauth/postfix-dot-notation/blob/master/postfix-dot-notation/lang/reader.rkt and have it reading in correctly. Don’t understand why read is the wrong approach but read-syntax works just fine


zenspider
2017-7-1 22:31:28

can somebody help me with this last bit? I clearly don’t understand something in the glue of racket’s #lang handling:

https://gist.github.com/6c4e50cdea9925f706ac1ff0019e3105

outputs:

code:
(module basic-mod basic/expander
  (b-program
   (b-line ...lots of stuff...)))
define:
run:
dynamic-require: unknown module
  module name: #<resolved-module-path:'basic-mod>
  context...:
   /Users/ryan/Work/git/zenspider/schemers/br/basic/basic: [running body]

mflatt
2017-7-1 22:49:22

The module is declared in ns, but ns isn’t the current namespace when dynamic-require looks for a module.


zenspider
2017-7-1 22:55:45

but if I declare the module in current-namespace then it blows up because module and #%app aren’t defined


mflatt
2017-7-1 22:56:16

I recommend using dynamic-wind with ns: (parameterize ([current-namespace ns]) (dynamic-require ''basic-mod #f))


zenspider
2017-7-1 22:57:01

and not using make-resolved-module-path ?


zenspider
2017-7-1 22:57:20

that was it…


zenspider
2017-7-1 22:57:32

how could I have figured that out??


samth
2017-7-1 22:59:37

@zenspider what led you to use make-resolved-module-path originally? was that described in Beautiful Racket?


mflatt
2017-7-1 23:00:12

Using woot in place of ''basic-mod (uncommenting out the two earlier lines that set it up) is a fine idea. Usually the goal is to use a path instead of a symbol, though.


mflatt
2017-7-1 23:00:44

@samth I think I earlier recommended using current-module-declare-name, which needs a resolved module path


zenspider
2017-7-1 23:04:17

wow! Process Racket REPL abort trap: 6 go me!


zenspider
2017-7-1 23:05:00

should my reader be doing a gensym for the module name? If I add multiple basic files on the cmdline the second one blows up because it’s the same name


zenspider
2017-7-1 23:05:41

@mflatt thank you… that was 2 hours in the making and I wouldn’t have come up with that diagnosis or that 2 line block of code


zenspider
2017-7-1 23:06:16

is there a way to tell that I’m running in the repl vs not?


zenspider
2017-7-1 23:06:36

right now I’m testing (current-command-line-arguments) being empty, but that isn’t right


notjack
2017-7-1 23:07:19

The REPL wraps forms in #%top-interaction, so you could customize that form to set a parameter that you inspect


zenspider
2017-7-1 23:09:57

@notjack … idgi… how would it know that it is in the repl? by being used? that implies I won’t know until it’s eval’d something and displayed it?


notjack
2017-7-1 23:11:20

Racket wraps all REPL expressions in #%top-interaction for you. So you define your lang’s #%top-interaction to be a macro that sets a parameter like (current-eval-is-repl?) to true, then you can dynamically do something different in the repl.


notjack
2017-7-1 23:12:27

The #lang racket language doesn’t do this so it would only work in a custom language where you redefined #%top-interaction


zenspider
2017-7-1 23:35:19

ok. make-resolved-module-path with gensym seems to be a happy combo


zenspider
2017-7-1 23:35:29

zenspider
2017-7-1 23:35:51

I’m now trying to take it one step further and get it so I can shebang the basic files and run them directly


samth
2017-7-1 23:37:07

@notjack can I suggest that you do development on your fork, rather than in racket/rackunit?


samth
2017-7-1 23:37:19

I ask mostly because commits to racket/rackunit send a bunch of people mail


notjack
2017-7-1 23:38:52

@samth is it possible to change the mail settings? working on the fork is slightly irritating


samth
2017-7-1 23:39:43

Sadly there’s no option to only send mail for master


notjack
2017-7-1 23:39:54

is it github mail or travis mail?


samth
2017-7-1 23:40:50

it’s github mail


zenspider
2017-7-1 23:42:07

@notjack I think if you worked in a branch it wouldn’t send email


samth
2017-7-1 23:42:40

@zenspider that’s not correct, sadly — @notjack is working on a branch


notjack
2017-7-1 23:42:44

I am working in branches - checking https://help.github.com/articles/about-notification-emails/ for more details


zenspider
2017-7-1 23:42:58

at least… that’s how we work on some of our projects and we don’t get inundated by my crazy commit storms


samth
2017-7-1 23:43:14

@notjack it’s a hook, that sends mail to a mailing list


samth
2017-7-1 23:43:19

it’s not notification email


notjack
2017-7-1 23:43:26

ohhh, so it’s not coming directly from github?


notjack
2017-7-1 23:43:37

wait what list


samth
2017-7-1 23:44:09

github has an “email” service, and that’s set up to email <mailto:committers@racket-lang.org\|committers@racket-lang.org> which is basically all the people who got email before we moved the canonical repo to github


zenspider
2017-7-1 23:44:16

ah. gotcha



samth
2017-7-1 23:44:59

perhaps we should just get rid of it, but for the moment it’s easier to just keep it


samth
2017-7-1 23:45:15

@notjack yes


zenspider
2017-7-1 23:45:45

final version… https://gist.github.com/zenspider/6c4e50cdea9925f706ac1ff0019e3105 … is something like run-with-lang of general use?


notjack
2017-7-1 23:48:25

@samth I’ll work on the fork, sorry about the noise


samth
2017-7-1 23:48:32

@notjack thanks


notjack
2017-7-1 23:48:39

shame it can’t distinguish master from non-master though


samth
2017-7-1 23:49:07

This is in reality not a great system since it’s really reliant on the not-true idea that there’s a general “committers” set for all of Racket


notjack
2017-7-1 23:49:25

was it created pre-package-split?


samth
2017-7-1 23:50:16

no it was created to emulate the old behavior when we split the old repository


samth
2017-7-1 23:50:35

because the old repo of course had a single set of committers


notjack
2017-7-1 23:50:47

gotcha


notjack
2017-7-1 23:53:21

@samth the incomplete PRs I’ve got open already would be difficult to move, is it alright if I just do new dev on the fork?


samth
2017-7-1 23:53:51

yes that’s certainly fine