> # (1,2);
2
> # (1);
#1
> # ();
0
--
You received this message because you are subscribed to the Google Groups "pure-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pure-lang+unsubscribe@googlegroups.com.
To post to this group, send email to pure...@googlegroups.com.
Visit this group at https://groups.google.com/group/pure-lang.
For more options, visit https://groups.google.com/d/optout.
Well, there's no real 1-tuple in Pure, and having a fallback rule like #x=1 in the prelude might mess with user code which wants to overload # for some data structure.Maybe the prelude shouldn't define # on tuples at all, to avoid that ugly corner case.
On Fri, Jan 5, 2018 at 7:11 PM, Andrew Dabrowski <unhan...@gmail.com> wrote:
Why does # (1); not return 1?
> # (1,2);
2
> # (1);
#1
> # ();
0
--
You received this message because you are subscribed to the Google Groups "pure-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pure-lang+...@googlegroups.com.
To post to this group, send email to pure...@googlegroups.com.
Visit this group at https://groups.google.com/group/pure-lang.
For more options, visit https://groups.google.com/d/optout.
So what's the idiomatic way to test the length of sequence? For example if I want to do F if the length is 0, G if 1, H if longer than 1?