Skip to content
This repository has been archived by the owner on May 11, 2019. It is now read-only.

RFC: Tuples #9

Open
Qix- opened this issue May 31, 2016 · 4 comments
Open

RFC: Tuples #9

Qix- opened this issue May 31, 2016 · 4 comments
Labels

Comments

@Qix-
Copy link
Owner

Qix- commented May 31, 2016

TODO

@Qix-
Copy link
Owner Author

Qix- commented Jun 4, 2016

@PolyGN thoughts on Tuples? I feel like Tuple support without full-on pattern matching throughout the system is useless. I like the idea of pattern matching though I feel like languages that use it right now cause the syntax/semantics to look super messy (Rust is a great example of a good idea gone terribly ugly insofar as pattern matching, in my opinion).

@Qix- Qix- added the todo label Jun 4, 2016
@corbin-r
Copy link

corbin-r commented Aug 31, 2016

@Qix-
Here's my idea on Tuples in this language.

Yes, tuples without full pattern matching would indeed be useless. And as far the syntax for the possible pattern matching?

... Could be something like this [not going to do anything like Rust, cause it is, as you said, "terribly ugly"]

    let foo = 4

    foo => { 1: print("Stuff"), 2: print("Matched 2"), 3: print("Matched 3"), _: print("Some default print") }

I don't know, I'm trying to think as concise and simple as I can. If you have some thoughts on this, definitely throw some critique on this!

@Qix-
Copy link
Owner Author

Qix- commented Sep 1, 2016

What does that example intend to do?

@Qix-
Copy link
Owner Author

Qix- commented Nov 1, 2016

Another idea:

on Foo
    fn do_something()
        # ...

foo1 Foo
foo2 Foo

(foo1, foo2).do_something()

Which is similar to Pythons:

[x.do_something() for x in (foo1, foo2)]

and functionally equivalent to

foo1.do_something()
foo2.do_something()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants