Re: Is there a better way to get to `Classname[].class` ?

2017-10-11 Thread pericles macedo
Thanks Peter, Yeah, I didn't find that reference before. It would have saved me a couple hours. I found something similar in a few places, but it only had the primitive types. It missed the class specific element type. On Tuesday, October 10, 2017 at 3:22:38 AM UTC-7, Peter Hull wrote: > > I

Re: Is there a better way to get to `Classname[].class` ?

2017-10-10 Thread Peter Hull
I actually preferred your solution, pericles, because it doesn't require memorising the "[L...;" syntax, and works if you don't know the class at compile time. By the way you can use make-array to create a zero size array which might be (ever so slightly) more efficient. For reference

Re: Is there a better way to get to `Classname[].class` ?

2017-10-10 Thread Gary Verhaegen
What Alex suggested is probably the best approach here. Note: there's a typo in my message, the name of the class needs to be as Alex says for the type hint too, i.e. the L and ; are essential for this to work. > On 9 Oct 2017, at 18:31, pericles macedo wrote: > >

Re: Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread pericles macedo
Hey Gary, thanks for the help I'm not sure if a type hint would work in this case, as the attribute expect a class literal, and not a variable of that specific class. Thanks for the example though, I didn't know that was a valid type hint. About what I'm trying to do, I'm using a gitlab api gem

Re: Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread pericles macedo
Thanks Alex :) Yes, that works better On Monday, October 9, 2017 at 9:21:24 AM UTC-7, Alex Miller wrote: > > (Class/forName "[Lorg.gitlab.api.models.GitlabProject;") > > > On Monday, October 9, 2017 at 10:38:37 AM UTC-5, pericles macedo wrote: >> >> Hey Guys, >> I wanted to know if there is a

Re: Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread Alex Miller
(Class/forName "[Lorg.gitlab.api.models.GitlabProject;") On Monday, October 9, 2017 at 10:38:37 AM UTC-5, pericles macedo wrote: > > Hey Guys, > I wanted to know if there is a better way to get to the same result as > `GitlabProject[].class` > after some digging around, I got to this array of

Re: Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread Gary Verhaegen
You can generally use ^"[fully.qualified.ClassName" as the type hint, if that's what you're trying to do. I'm not quite sure of the benefits of typing an array when it's not a primitive one, though. What are you trying to accomplish, if we zoom back a little bit? Maybe there's a better way to

Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread pericles macedo
Hey Guys, I wanted to know if there is a better way to get to the same result as `GitlabProject[].class` after some digging around, I got to this array of class definition by doing something like `(class (make-array GitlabProject 1))`. But I don't know if there is a better way to get to this