Quantcast
Channel: Variadic Generics
Browsing all 25 articles
Browse latest View live

Variadic Generics

Here there are some informations about what can / should be done to implement this, but I don’t know if the information is stale as of today. The key is to proceed step by step, implementing one piece...

View Article



Variadic Generics

@technicated the proposal is great! The cool thing about variadic generics is building recursive types and data structures, something like struct Recursive<Head, variadic Tail> { var head: Head...

View Article

Image may be NSFW.
Clik here to view.

Variadic Generics

Alexey_Komnin: The problem is, there should exist a terminal type defined or some kind of condition ti stop the recursion. How would you suggest to handle this? If you cannot initialize a value of...

View Article

Variadic Generics

I've just thrown out an idea in the thread mentioned by @technicated . A basic idea could be that variadic types are always declared in terms of at least two types, like this: @variadic(S,T) func...

View Article

Variadic Generics

There is always a finite number of generic parameters, isn't it? Yet recursion always needs a terminal condition. The value of variadic generics is doubtful if there is no support for recursion. Read...

View Article


Variadic Generics

This is something I thought about and could not find a solution i.e. what happens when Tail is emptied going down into the recursion? What is Head going to be? This kind of code should be a compile...

View Article

Image may be NSFW.
Clik here to view.

Variadic Generics

technicated: What is Head going to be? Head is always safe as it isn't splatted. technicated: This kind of code should be a compile error? Unfortunately, yes. As in the last call of Recursive no...

View Article

Image may be NSFW.
Clik here to view.

Variadic Generics

DevAndArtist: technicated: We might also want to seek some guidance from the Core Team! Definitely from @Douglas_Gregor as he co-authored this paper: http://www.jot.fm/issues/issue_2008_02/article2/...

View Article


Image may be NSFW.
Clik here to view.

Variadic Generics

But today Swift does not allow for this: two types with the same name and different generic parameters cause an error: invalid redeclaration of ‘Recursive’, so this would need to be special-cased...

View Article


Variadic Generics

I thought about yet another problem. In the current git repo for the proposal, it is mentioned that the variadic type should conform to Collection. But what the hell would MyVariadicType.Element be?...

View Article

Variadic Generics

No, I often use Collection as a constraint but only in the #head, #tail, #length, #reduce, #ifempty section I suggest to explore (not super convinced) what can happen, what we gain and what can go...

View Article

Variadic Generics

It's a super essential feature. If no one can take it over we need help from the core team, don't we? Can we help with prioritization or something? We're about to have Swift 6 and so sad to see than...

View Article

Image may be NSFW.
Clik here to view.

Variadic Generics

technicated: But today Swift does not allow for this: two types with the same name and different generic parameters cause an error: invalid redeclaration of ‘Recursive’ , so this would need to be...

View Article


Variadic Generics

If Swift is going to evolve this way, something similar to SFINAE has to be introduced, and it would increase the complexity significantly. Read full topic

View Article

Variadic Generics

I spent some time playing with different applications of the variadic usage, and I think there should exist some set of operations defined on the variadic type. For example, it is essential to compare...

View Article


Variadic Generics

I think the opposite it's truth, if we automatically convert errors to properly working code we end up with a lot of ambiguous meanings over time. Okay I understand a bit what you mean but SFINAE...

View Article

Image may be NSFW.
Clik here to view.

Variadic Generics

Alexey_Komnin: The main question I am not able to solve, what is an empty variadic? @technicated, in your proposal you declare an empty variadic syntax - "<>" and show it is possible to define a...

View Article


Image may be NSFW.
Clik here to view.

Variadic Generics

Alexey_Komnin: struct Variadic<variadic T> where T.count > 0 { var value: T[0] var tail: T[1..<T.count] } The main question I am not able to solve, what is an empty variadic? Shouldn‘t...

View Article

Variadic Generics

Let's look at the Variadic Generics at the value level section. Here I say that values of variadic type are called Variadic Values and have their unique set of API, extending that of Collection; more...

View Article

Image may be NSFW.
Clik here to view.

Variadic Generics

I don't know if it has already been told, but in the Variadic Values subsection it is stated: A variadic value can never leave a generic context ⏤ it must always be transformed in something else to do...

View Article
Browsing all 25 articles
Browse latest View live




Latest Images