faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
<FromGitter> <andrewc910> I spent all morning trying to come up with a solution. I was hoping to put the current render method into a new class but i don't think it can be done. Well at least my implementation. The current `render` has to be called with a direct string: ⏎ ⏎ ```def index ⏎ t = "index.slang" ⏎ render(t) ⏎ end``` ⏎ ⏎ I always forget this nuance of macros. Makes me sad
<FromGitter> <Blacksmoke16> what does `render` macro look like?
<FromGitter> <Blacksmoke16> just the default thing from slang?
<FromGitter> <Blacksmoke16> could try using an annotation and update that method to check for it before raising
<FromGitter> <andrewc910> Ultimately, views are in the same scope as controllers. I wanted to make it that views were a separate scope.
<FromGitter> <Blacksmoke16> ```@[Template("index.slang")] ⏎ def index ⏎ render() ⏎ end``` [https://gitter.im/amberframework/amber?at=5f048efb64ef9d04b299c3cc]
<FromGitter> <Blacksmoke16> not sure if the macro would have access to the method's annotations, id imagine it would tho
<FromGitter> <andrewc910> ```code paste, see link``` ⏎ ⏎ Here is a quick example. We have discussed this before on a different problem :/ ⏎ ⏎ Everything else i can think of in terms of creating a new scope, would create a new scope but would still have access to the controller. [https://gitter.im/amberframework/amber?at=5f048fd46e1b8050c3db5e35]
<FromGitter> <andrewc910> Kilt & ECR uses macros so everything between "render" in the controller and hitting `ECR.embed` needs to be a macro. Because everything is macros, idk how to create a new scope :(
<FromGitter> <andrewc910> ```code paste, see link``` ⏎ ⏎ That's possible but IDK how keen I am on the constants [https://gitter.im/amberframework/amber?at=5f0493533c217837fd824371]
<FromGitter> <Blacksmoke16> hm
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <Blacksmoke16> seems kinda strange, is just kinda floating in the class
<FromGitter> <andrewc910> And it wouldn't work haha. Missed a step:
<FromGitter> <andrewc910> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5f0495a9a9378637e8b2490e]
<FromGitter> <Blacksmoke16> rip
<FromGitter> <andrewc910> rip
<FromGitter> <andrewc910> First time working with annotations so I may be doing it wrong but i dont think that would work either: ⏎ ⏎ `````` [https://gitter.im/amberframework/amber?at=5f0498f9a9378637e8b252c0]
<FromGitter> <Blacksmoke16> hm
<FromGitter> <Blacksmoke16> ``` def self.render(t) ⏎ Kilt.render(t) ⏎ end``` [https://gitter.im/amberframework/amber?at=5f0499a28342f46274fd0f73]
<FromGitter> <Blacksmoke16> this part breaks it
<FromGitter> <andrewc910> Yeah but it's necessary for creating that new scope :( I just don't think it can be done.
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <andrewc910> Well thanks for the help :)
<FromGitter> <Blacksmoke16> np, gl
<robacarp> @andrewc910 thanks for trying :)
<FromGitter> <Blacksmoke16> robacarp: https://github.com/robacarp/mosquito/blob/master/src/mosquito/runner.cr#L120 should probably use `.real`
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/9e1k
<FromGitter> <Blacksmoke16> thats prob the more useful, esp when dealing with concurrency and such
<FromGitter> <Blacksmoke16> metric*
<robacarp> yeah, for sure. The benching api has grown up a lot since I put that in
<FromGitter> <Blacksmoke16> or really just use `Time.measure`
<FromGitter> <Blacksmoke16> and use `.total_seconds`
<robacarp> needs to be more precise than seconds
<robacarp> I'm waiting to put effort into real concurrency until cry 1 drops at least
<robacarp> I'm pretty sure I'll be able to swap out one data structure for a synchronized queue and the rest should just drop into place
<robacarp> yeah, with https://crystal-lang.org/api/master/Time.html#measure(&):Time::Span-class-method above
<FromGitter> <Blacksmoke16> yup
feepbot has quit [Ping timeout: 258 seconds]
feepbot has joined #amber
feepbot has quit [Ping timeout: 240 seconds]
feepbot has joined #amber
confact has quit [Ping timeout: 272 seconds]