Files
2012-02-21 01:15:00 -05:00

1 line
6.5 KiB
JSON

[{"user_id": 32737, "stars": [], "topic_id": 36085, "date_created": 1305870785.0529339, "message": "I brought this up before, but you (awwx) said you didn't like it. I don't think you really gave any reasons why, so here's a reason why I think you should implement this:", "group_id": 9739, "id": 1121077}, {"user_id": 32737, "stars": [], "topic_id": 36085, "date_created": 1305870831.9317031, "message": "Right now, the way to import Racket modules into Arc is as follows:\n\n(racket (racket-require (racket-prefix-in racket- scheme/tcp)))", "group_id": 9739, "id": 1121083}, {"user_id": 32737, "stars": [], "topic_id": 36085, "date_created": 1305870907.5411501, "message": "Wow, what a mouthful! So I tried to write a racket-require macro, so you could just do this:\n\n(racket-require scheme/tcp)\n\nBut guess what? Doesn't work. Because you're trying to override the Racket \"require\". This should work fine if the Arc namespace inherited from the Racket namespace.", "group_id": 9739, "id": 1121091}, {"user_id": 32737, "stars": [], "topic_id": 36085, "date_created": 1305871023.6802239, "message": "Another reason to do this: if you exposed this mechanism to Arc, then Arc could create namespaces that inherit from other namespaces... which means something like Arubic's \"import\" would be trivial to write.\n\nSo yeah, sure, I could write namespaces-that-inherit as a library (using defrule, etc.), but having them in the core would let me \"overwrite\" Racket stuff like racket-require.", "group_id": 9739, "id": 1121108}, {"user_id": 32737, "stars": [], "topic_id": 36085, "date_created": 1305871855.289041, "message": "So... I guess that weakens my argument somewhat. :P In any case, I'd still be interested in hearing your objections to namespace inheritance (in the core).", "group_id": 9739, "id": 1121251}, {"user_id": 32737, "stars": [], "topic_id": 36085, "date_created": 1305871064.2629499, "message": "So... what objections do you have to this?", "group_id": 9739, "id": 1121113}, {"user_id": 32737, "stars": [], "topic_id": 36085, "date_created": 1305871529.828831, "message": "(Also, I'm going to call it rckt-require for now, so it actually works)", "group_id": 9739, "id": 1121185}, {"user_id": 32737, "stars": [], "topic_id": 36085, "date_created": 1305871149.6674659, "message": "(By the way, namespaces are already implemented as a hash table, that has a single key: racket-namespace* So... I think all you would need to do is add on a \"parent\" key, and then change global variable lookup/assignment to be aware of the \"parent\" key)", "group_id": 9739, "id": 1121125}, {"user_id": 32737, "stars": [], "topic_id": 36085, "date_created": 1305871640.6088519, "message": "Also also, if you have suggestions for how to get the \"want to write a macro called racket-require\" thing working without implementing namespace inheritance, I'd be interested in hearing it.", "group_id": 9739, "id": 1121212}, {"user_id": 32737, "stars": [], "topic_id": 36085, "date_created": 1305871789.444592, "message": "Hm... I just realized. \"require\" is a Racket macro, right? So even if there was namespace inheritance, it probably *still* wouldn't work. You'd probably need to use Racket's macro expander.", "group_id": 9739, "id": 1121241}, {"user_id": 25438, "stars": [], "topic_id": 36085, "date_created": 1305907930.514627, "message": "My goal is to let you use namespace inheritance in the core when you want to, but not impose it on everyone as the default. The first step is to get everything into one namespace. (Which ar isn't doing yet, because the ac.ss definitions are in their own module). Then, the next step is to allow you to put whatever core functions into different namespaces you want, when you want to.", "group_id": 9739, "id": 1127345}, {"user_id": 32943, "stars": [], "topic_id": 36085, "date_created": 1305930066.3080621, "message": "I think namespace inheritance is helpful for hackability: If my code imports some library, it should be able to modify/extend that module's 'foo and get its 'bar for free. However, I see the namespace as always being a finite partial namespace inheriting from a finite partial namespace ultimately inheriting from an infinite base namespace, and that it's that base namespace that's modified by a (def ...).", "group_id": 9739, "id": 1131097}, {"user_id": 32943, "stars": [], "topic_id": 36085, "date_created": 1305930133.3807759, "message": "So I don't want the base namespace to be a Racket namespace, since module bindings in Racket are immutable by default.", "group_id": 9739, "id": 1131103}, {"user_id": 32943, "stars": [], "topic_id": 36085, "date_created": 1305930306.3268051, "message": "On the other hand, a system where each library is explicitly loaded into a single shared infinite namespace, with no inheritance, is consistent with itself, and it still allows for hackability.", "group_id": 9739, "id": 1131114}, {"user_id": 32943, "stars": [], "topic_id": 36085, "date_created": 1305930256.6523321, "message": "And in this case I don't think it makes so much sense to consider the namespace to be the thing which is exported by a module. It's infinite, while export/import lists are finite.", "group_id": 9739, "id": 1131111}, {"user_id": 32943, "stars": [], "topic_id": 36085, "date_created": 1305930363.4787741, "message": "(By \"single\" I only mean the typical case. Multiple shared namespaces could be used.)", "group_id": 9739, "id": 1131118}, {"user_id": 25438, "stars": [], "topic_id": 36085, "date_created": 1305935564.2498951, "message": "\"So I don't want the base namespace to be a Racket namespace, since module bindings in Racket are immutable by default.\"\n\nActually Racket modules and Racket namespaces are two different things.", "group_id": 9739, "id": 1131398}, {"user_id": 32943, "stars": [], "topic_id": 36085, "date_created": 1305936916.3117421, "message": "My experimentation with Racket namespaces and modules went as far as https://github.com/nex3/arc/blob/master/lib/ns.arc and https://github.com/nex3/arc/blob/master/lib/ns.arc.t, if it helps any. ^^", "group_id": 9739, "id": 1131433}, {"user_id": 32943, "stars": [], "topic_id": 36085, "date_created": 1305936539.055222, "message": "Yeah, I know that. ^_^ But most of the bindings we would inherit from Racket are going to be imports from some base Racket language module. Still, you might implement global variable assignment such that the binding is always turned into a top-level binding (which I think just takes well-chosen flags for 'namespace-set-variable-value!), and I can't object to that necessarily....", "group_id": 9739, "id": 1131420}]