Re: [rust-dev] Concurrency and synchronous blocking

2012-07-11 Thread Ziad Hatahet
On Wed, Jul 11, 2012 at 10:27 AM, Florian Weimer f...@deneb.enyo.de wrote: This approach is fundamentally broken. If the timeout ever kicks in, goroutines will pile up without bounds. I just want to be clear on your comment. You mean the goroutines would pile up, or the channel will grow

Re: [rust-dev] Concurrency and synchronous blocking

2012-07-12 Thread Ziad Hatahet
Ah, you mean after repeated invocations of the containing function in case the timeout event keeps firing? -- Ziad On Wed, Jul 11, 2012 at 10:52 PM, Florian Weimer f...@deneb.enyo.de wrote: * Ziad Hatahet: On Wed, Jul 11, 2012 at 10:27 AM, Florian Weimer f...@deneb.enyo.de wrote

Re: [rust-dev] Bikeshed proposal to simplify syntax

2012-07-18 Thread Ziad Hatahet
Not to start a religious war, but maybe using camelCase instead of under_score would save even more space given the 78-character line limit? :) -- Ziad On Tue, Jul 17, 2012 at 9:03 PM, Niko Matsakis n...@alum.mit.edu wrote: This is interesting. When I first started working on the Rust

Re: [rust-dev] RFC: Ignore trailing semicolons

2012-08-01 Thread Ziad Hatahet
I agree with Glenn. I personally did not have an issue while trying to pick up Rust to figure out the implicit return with the lack of the semi-colon. In fact, I was able to pick up this pattern just by browsing some Rust code and not looking at the manual or tutorial pages. :) I also think that

Re: [rust-dev] Rust lightning talk at JavaZone 2012

2012-08-24 Thread Ziad Hatahet
On Thu, Aug 23, 2012 at 8:16 PM, Jeffery Olson olson.jeff...@gmail.comwrote: And, to be fair, another major plank of the linked post was that Option-style library APIs aren't ubiquitous even in Scala, and certainly not in the larger Java Class Library. This is not true for Rust, where

Re: [rust-dev] Time to rename the 'unsafe' mods

2012-09-12 Thread Ziad Hatahet
+1 for sys or system. -- Ziad On Wed, Sep 12, 2012 at 2:55 PM, Patrick Walton pwal...@mozilla.com wrote: On 9/12/12 2:54 PM, Brian Anderson wrote: So I don't have any great ideas. Do you? raw? lowlevel (ll)? machine? sys? Patrick __**_

Re: [rust-dev] rust-0.4 on osx - expected `/str` but found `static/str`

2012-10-03 Thread Ziad Hatahet
So will we always have to dereference a ref variable using the asterisk symbol? In effect this is passing a pointer (like C), correct? What about if we want to call a method on a ref variable, will it be a.foo(), or (*a).foo()? Thanks -- Ziad On Wed, Oct 3, 2012 at 7:15 PM, Patrick Walton

Re: [rust-dev] Purity by default

2012-10-24 Thread Ziad Hatahet
On Wed, Oct 24, 2012 at 2:05 PM, Patrick Walton pwal...@mozilla.com wrote: Oh, in that case I totally agree. I thought Nathan was asking for the purity specified in the function signature to always match the inferred purity of the function--in particular, for the compiler to enforce that a

Re: [rust-dev] Lifetime notation

2013-01-31 Thread Ziad Hatahet
Would using a dot '.' instead of a quote ' also resolve the ambiguity, without introducing an extra sigil into the language? {.lt}T T{.lt} -- Ziad On Thu, Jan 31, 2013 at 6:33 AM, Benjamin Striegel ben.strie...@gmail.comwrote: +1 to this. Option 8 was always the best-case syntax, and

Re: [rust-dev] Lifetime notation

2013-01-31 Thread Ziad Hatahet
On Thu, Jan 31, 2013 at 7:11 AM, Dean Thompson deansherthomp...@gmail.comwrote: I expect it would, but at the expense of no longer being able to make as simple a statement in the language tutorial as this: The notation 'foo means a lifetime called foo. To me, it seems nicer for a newbie

Re: [rust-dev] Tuples and to_str()

2013-01-31 Thread Ziad Hatahet
As others mentioned, it is to_str() instead of to_string(). You can also use the %? format string qualifier: io::println(fmt!(Tuple is %?, (1, 2))); -- Ziad ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

[rust-dev] Questions about pointers

2013-02-03 Thread Ziad Hatahet
Hi all, I was playing around with the different pointer types in Rust, and I have the following program: https://gist.github.com/4702154 My questions/comments are listed in lines 16, 23, 27, and 29. As a side note, I believe that there is still work being done on having mutability depend on the

Re: [rust-dev] 3 Gripes on Rust

2013-04-07 Thread Ziad Hatahet
On Sun, Apr 7, 2013 at 3:01 PM, Heri Sim her...@gmail.com wrote: Passing in a stack-local variable to a function or closure (that requires arguments to be passed by reference), should not require the ampersand () in the caller. Why can't the compiler figure this out? This is one of the

Re: [rust-dev] automatic dereferences and semicolons

2013-04-12 Thread Ziad Hatahet
Second thing: why are semicolons required at the end of lines at all? Go, Scala etc. manage fine without. Go has some weird edge cases due to semi-colon insertion. I don't know if Scala managed to prevent those though. -- Ziad ___ Rust-dev mailing

Re: [rust-dev] Calling static methods on type parameters?

2013-05-15 Thread Ziad Hatahet
I tried the above, but I got the following errors: $ rustc -v rustc 0.6 host: x86_64-unknown-linux-gnu $ cat static_type.rs trait Newable { fn new() - Self; } struct Foo(int); impl Newable for Foo { fn new() - Foo { Foo(1) } } fn getOneOfTheseT: Newable() - T { let x:T =

[rust-dev] Parallelism and concurrency need different tools

2013-05-16 Thread Ziad Hatahet
Good article I came by via Hacker News: http://www.yosefk.com/blog/parallelism-and-concurrency-need-different-tools.html I figured people here would be interested. -- Ziad ___ Rust-dev mailing list Rust-dev@mozilla.org

Re: [rust-dev] Calling static methods on type parameters?

2013-05-21 Thread Ziad Hatahet
On Wed, May 15, 2013 at 12:29 PM, Patrick Walton pwal...@mozilla.com wrote: You can't specify type parameters explicitly here; instead you need to use `let test: Foo = ...`. I just found out that the following also works: let test = getOneOfThese::Foo(); Is one style preferred over the

Re: [rust-dev] Calling static methods on type parameters?

2013-05-21 Thread Ziad Hatahet
On Tue, May 21, 2013 at 10:58 AM, Niko Matsakis n...@alum.mit.edu wrote: This form is unlikely to continue working in the future. Instead, a new syntax will be introduced. See this blog post for more details:

[rust-dev] Do-notation?

2013-05-23 Thread Ziad Hatahet
Say we want to implement the following function: fn add(x: Optionint, y: Optionint) - Optionint { ... } Some functional languages, like Haskell and Scala offer some sort of a do notation to make unwrapping multiple Option type values easier. add :: Maybe Int - Maybe Int - Maybe Int add mx my =

Re: [rust-dev] Do-notation?

2013-05-23 Thread Ziad Hatahet
Thanks all for the replies. Niko, could you point out where in the code you defined the macro you mention? Thanks -- Ziad ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] Any interest in a San Francisco Bay Area Rust meetup and/or hackathon?

2013-05-24 Thread Ziad Hatahet
I replied in private at the beginning. Too :) +1 -- Ziad ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

[rust-dev] Runtime cost of Option

2013-05-29 Thread Ziad Hatahet
Hi all, Does using Option incur a runtime cost (like increased memory usage) compared to a hypothetical case if Rust had a NULL type in the language? Or does it get optimized away, such that it is akin to using NULL in the first place (albeit safer of course)? I have not looked at any

[rust-dev] Mutability and borrowing

2013-06-01 Thread Ziad Hatahet
I have the following function: fn add_equal(x: mut Complex, y: Complex) { x.real += y.real; x.imag += y.imag; } Calling the function with the same variable being passed to both arguments (i.e. add_equal(mut c, c)), results in the compile error: error: cannot borrow `c` as immutable

Re: [rust-dev] Mutability and borrowing

2013-06-01 Thread Ziad Hatahet
is passed on both sides? -- Ziad On Sat, Jun 1, 2013 at 9:42 PM, Tim Chevalier catamorph...@gmail.comwrote: On Sat, Jun 1, 2013 at 9:33 PM, Ziad Hatahet hata...@gmail.com wrote: I have the following function: fn add_equal(x: mut Complex, y: Complex) { x.real += y.real; x.imag

Re: [rust-dev] Mutability and borrowing

2013-06-02 Thread Ziad Hatahet
On Sun, Jun 2, 2013 at 6:56 AM, Daniel Micay danielmi...@gmail.com wrote: You can currently use `const Complex` for the second parameter, but it may or may not be removed in the future. At the very least it will probably be renamed. Excellent. Thanks all for your replies :) -- Ziad

Re: [rust-dev] The future of iterators in Rust

2013-06-12 Thread Ziad Hatahet
On Wed, Jun 12, 2013 at 1:08 PM, Gareth Smith garethdanielsm...@gmail.comwrote: My rust code breaks every time I get the latest incoming anyway - and it is a pretty mechanical change. I agree. There are no guarantees that current code will not break in future versions of the language, until

Re: [rust-dev] The future of iterators in Rust

2013-06-12 Thread Ziad Hatahet
On Wed, Jun 12, 2013 at 1:58 PM, Graydon Hoare gray...@mozilla.com wrote: Eh, unclear to me. I am partial to the existing syntax (reads like do-notation, which I think we're keeping) and avoids breaking tons of code and adding a keyword. Also supports no-arg iteration like: I guess I wasn't

Re: [rust-dev] The 'for' syntax for iterators

2013-06-13 Thread Ziad Hatahet
Shouldn't we just be able to use map() and filter() routines to do the same? -- Ziad ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] The 'for' syntax for iterators

2013-06-13 Thread Ziad Hatahet
Perhaps you can get around somewhat by using macros? I asked the following question on the mailing list a while back, so maybe something similar can be used here: https://mail.mozilla.org/pipermail/rust-dev/2013-May/004176.html -- Ziad ___ Rust-dev

Re: [rust-dev] The 'for' syntax for iterators

2013-06-13 Thread Ziad Hatahet
On Thu, Jun 13, 2013 at 10:43 AM, Ziad Hatahet hata...@gmail.com wrote: Perhaps you can get around somewhat by using macros? I asked the following question on the mailing list a while back, so maybe something similar can be used here: https://mail.mozilla.org/pipermail/rust-dev/2013-May

Re: [rust-dev] The 'for' syntax for iterators

2013-06-13 Thread Ziad Hatahet
This thread made its way to the Rust subreddit, where people posted a couple of implementations using macros. Very cool stuff! http://www.reddit.com/r/rust/comments/1gag3t/list_comprehensions_in_rust_iterator/ http://en.wikipedia.org/wiki/List_comprehension#Rust -- Ziad

Re: [rust-dev] bikeshedding println() and friends

2013-07-14 Thread Ziad Hatahet
On Sun, Jul 14, 2013 at 10:09 AM, Daniel Micay danielmi...@gmail.comwrote: Scala, Go and D have compile-time checked, type-safe format strings for I/O. Unless I am missing something, Go does not check format strings at compile time. -- Ziad ___

Re: [rust-dev] Should I/O use conditions?

2013-10-17 Thread Ziad Hatahet
On Wed, Oct 16, 2013 at 3:38 PM, Patrick Walton pwal...@mozilla.com wrote: There's no difference except that let _ runs the destructor immediately whereas let _foo runs the destructor at the end of the block. (This is admittedly subtle.) I tried the following code snippet, but nothing got

Re: [rust-dev] Should I/O use conditions?

2013-10-17 Thread Ziad Hatahet
Thanks for the quick response :) -- Ziad On Wed, Oct 16, 2013 at 11:08 PM, Daniel Micay danielmi...@gmail.comwrote: On Thu, Oct 17, 2013 at 2:06 AM, Ziad Hatahet hata...@gmail.com wrote: On Wed, Oct 16, 2013 at 3:38 PM, Patrick Walton pwal...@mozilla.comwrote: There's no difference

Re: [rust-dev] Should I/O use conditions?

2013-10-18 Thread Ziad Hatahet
What about using Result types as mentioned here, but introducing some syntactic sugar to make chaining them easier? Something like Haskell's or Scala's do syntax: do ( a - x // x and y are Results b - y ) { /* do stuff with 'a' and 'b' */ } else { /* First Err is returned. Handle here. */ }

Re: [rust-dev] Should I/O use conditions?

2013-10-18 Thread Ziad Hatahet
I came across this blog post which may be relevant: https://coderwall.com/p/kokm7w -- Ziad On Fri, Oct 18, 2013 at 10:23 AM, Ziad Hatahet hata...@gmail.com wrote: What about using Result types as mentioned here, but introducing some syntactic sugar to make chaining them easier? Something

Re: [rust-dev] Unified function/method call syntax and further simplification

2013-10-19 Thread Ziad Hatahet
On Sat, Oct 19, 2013 at 1:52 PM, Patrick Walton pwal...@mozilla.com wrote: I think it's unfortunately too late to overhaul the language like this. This will require redesigns of all Rust code in existence. I do like unified function/method call syntax, but I think it can be done in a

Re: [rust-dev] Unified function/method call syntax and further simplification

2013-10-19 Thread Ziad Hatahet
On Sat, Oct 19, 2013 at 4:35 PM, David Piepgrass qwertie...@gmail.comwrote: In C# it's nice that I can find all the so-called extension methods by searching for (this . Aren't `impl`s in Rust somewhat similar to extension methods in C#? For instance: trait Doubler { fn double(self) -

Re: [rust-dev] writing file

2013-10-23 Thread Ziad Hatahet
On Wed, Oct 23, 2013 at 8:47 AM, Alex Crichton a...@crichton.co wrote: With these changes, the code would look like: use std::rt::io::File; let mut stream = File::create(test.txt); writeln!(mut stream, test {}, {}, {aa}, 1, 3.0, aa=2); How would errors be handled in this

Re: [rust-dev] More on stack safety

2013-10-29 Thread Ziad Hatahet
Stack overflow gets a mention in this article: http://www.edn.com/design/automotive/4423428/Toyota-s-killer-firmware--Bad-design-and-its-consequences:) -- Ziad On Tue, Oct 29, 2013 at 1:24 PM, Daniel Micay danielmi...@gmail.com wrote: On Tue, Oct 29, 2013 at 7:08 AM, Niko Matsakis

Re: [rust-dev] Checking error at opening file

2013-11-03 Thread Ziad Hatahet
Out of curiosity, why not make File::open() return a Result instead of Option like it does now? The current implementation already seems to be matching against the result of fs_open() and returning None if the result is Err(). So why the extra level of indirection and raising a condition in that

Re: [rust-dev] the inter-play of struct type impl, traits, type params

2013-11-05 Thread Ziad Hatahet
On Tue, Nov 5, 2013 at 9:17 AM, Patrick Walton pcwal...@mozilla.com wrote: On 11/5/13 2:44 AM, spir wrote: Why not just add a declaration of the trait at the top of the struct type def? struct PairListVal : Iterable { You can implement traits on types that aren't structs. Isn't

Re: [rust-dev] the inter-play of struct type impl, traits, type params

2013-11-05 Thread Ziad Hatahet
then there could be multiple such implementations for a given (trait, type) pair, and coherence would be broken. On Tue, Nov 5, 2013 at 2:28 PM, Ziad Hatahet hata...@gmail.com wrote: On Tue, Nov 5, 2013 at 9:17 AM, Patrick Walton pcwal...@mozilla.comwrote: On 11/5/13 2:44 AM, spir wrote: Why

Re: [rust-dev] the inter-play of struct type impl, traits, type params

2013-11-05 Thread Ziad Hatahet
. On Tuesday, November 5, 2013, Ziad Hatahet wrote: The following seems to work: trait Double { fn double(self) - Self; } impl Double for int { fn double(self) - int { *self * 2 } } fn main() { let x = 2; println!({}, x.double()); // prints 4

Re: [rust-dev] Implementation Inheritance / mixins

2013-11-16 Thread Ziad Hatahet
If structural inheritance were to be implemented, would we have the slicing problem in Rust, as it happens in C++? [1] http://en.wikipedia.org/wiki/Object_slicing [2] http://stackoverflow.com/questions/274626/what-is-the-slicing-problem-in-c/ -- Ziad

Re: [rust-dev] Implementation Inheritance / mixins

2013-11-16 Thread Ziad Hatahet
designed so that pointer types only form the subtyping relationship, eliminating this problem. BTW, I was thinking maybe we should just rename this feature to structural constraints to avoid the ewww, OO reactions. Ziad Hatahet hata...@gmail.com wrote: If structural inheritance were

Re: [rust-dev] Fwd: Please simplify the syntax for Great Justice

2013-11-18 Thread Ziad Hatahet
...and possibly change `~`. To what? -- Ziad On Tue, Nov 12, 2013 at 1:31 PM, Patrick Walton pcwal...@mozilla.comwrote: On 11/13/13 2:37 AM, Greg wrote: 1. ~[OptionBucketK,V] 2. fn linear_map_with_capacityK:Eq + Hash,V(capacity: uint) - LinearMapK,V 3. fn contains_key(self, k: K)

Re: [rust-dev] Fwd: Please simplify the syntax for Great Justice

2013-11-18 Thread Ziad Hatahet
On Mon, Nov 18, 2013 at 5:34 PM, Patrick Walton pcwal...@mozilla.comwrote: No, allocation would be with `new`. Would that have to proceed each allocation? For instance, would let v = ~[~one, ~two, ~three]; turn into let v = new Vector(new one, new two, new three); ? -- Ziad

Re: [rust-dev] Removing some autoref magic

2013-11-19 Thread Ziad Hatahet
Personally I would prefer if in Rust worked similar to const T in c++ In that case, you would not be able to tell whether a function argument was passed by value or by reference. I actually like this feature about Rust (C# has it too with the `ref` keyword). -- Ziad On Tue, Nov 19, 2013 at

Re: [rust-dev] list of all reserved keywords of the language

2013-11-20 Thread Ziad Hatahet
On Wed, Nov 20, 2013 at 10:37 AM, Brian Anderson bander...@mozilla.comwrote: Of course, `case` doesn't mean anything in this language... Hmm, Scala? ;) ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] Removing some autoref magic

2013-11-20 Thread Ziad Hatahet
What about @/Gc types then? You could still potentially reuse them. -- Ziad On Wed, Nov 20, 2013 at 5:58 PM, Tommi rusty.ga...@icloud.com wrote: While I'm trying to argue why the proposed solution is not a full solution to the proposed problem, I don't even think that the proposed problem is

Re: [rust-dev] Removing some autoref magic

2013-11-20 Thread Ziad Hatahet
On Wed, Nov 20, 2013 at 5:58 PM, Tommi rusty.ga...@icloud.com wrote: Here's why: if you make a call foo(arg) and never use arg after that, then you don't care if arg gets moved or borrowed. And if you try to use arg afterwards and foo did in fact move it previously, then your IDE is going to

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-11-30 Thread Ziad Hatahet
Would it not be possible to have new be a keyword, yet not a reserved word (since they are not the same thing). This leaves the possibility of using it as a method name (e.g. Struct::new()), while still using it as an operator. -- Ziad On Sat, Nov 30, 2013 at 1:07 AM, David Rajchenbach-Teller

Re: [rust-dev] do

2013-11-30 Thread Ziad Hatahet
Should an issue for this be filed then? -- Ziad On Sat, Nov 30, 2013 at 10:20 AM, Patrick Walton pcwal...@mozilla.comwrote: On 11/30/13 10:05 AM, Kevin Cantu wrote: While we're changing this stuff, I'd like to see lambdas allow return, now that the need for forbidding that is gone, IIRC.

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-11-30 Thread Ziad Hatahet
On Sat, Nov 30, 2013 at 1:54 PM, Patrick Walton pcwal...@mozilla.comwrote: The other suggestion that's been floated that satisfies all of these constraints is `alloc`, and honestly, if `new` is that unpopular maybe we should just switch to that. It's not that I'm unconcerned about `new()(1 +

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Ziad Hatahet
On Mon, Dec 2, 2013 at 12:43 AM, Eric Reed ecr...@cs.washington.edu wrote: In either case, I think keeping ~ as sugar for allocating on the exchange heap would be nice (i.e. ~expr is sugar for ~expr in Unique or put expr in Unique). `box expr in place` reads nicely too. I don't know about

[rust-dev] Interesting talk about (scala) language/compiler complexity

2013-12-04 Thread Ziad Hatahet
To be taken with a grain of salt, naturally: https://www.youtube.com/watch?v=TS1lpKBMkgg -- Ziad ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] Let’s avoid having both foo() and foo_opt()

2013-12-06 Thread Ziad Hatahet
I posted a question on the mailing list concerning this back in May: https://mail.mozilla.org/pipermail/rust-dev/2013-May/004176.html There were a couple of responses which implemented this in a macro. It would be nice if it were at the language level though. -- Ziad On Fri, Dec 6, 2013 at

Re: [rust-dev] Let’s avoid having both foo() and foo_opt()

2013-12-08 Thread Ziad Hatahet
On Sat, Dec 7, 2013 at 2:21 PM, Gábor Lehel illiss...@gmail.com wrote: I do wonder whether it wouldn't make sense to add sugar for Option, at least eventually. (`int?` at the type level is really nice, too... too bad it doesn't play so well with Rust's sigils. Introducing the potential

[rust-dev] List of potential C# 6.0 features

2013-12-10 Thread Ziad Hatahet
Thought this would be of interest to the list: http://damieng.com/blog/2013/12/09/probable-c-6-0-features-illustrated -- Ziad ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] List of potential C# 6.0 features

2013-12-11 Thread Ziad Hatahet
. ~Brendan On 12 Dec 2013, at 9:57 am, Zack Corr z...@z0w0.me wrote: Yes, but Rust doesn't have HKT. I was suggesting it on this basis. I'd prefer `do` as well. On Wed, Dec 11, 2013 at 5:25 PM, Ziad Hatahet hata...@gmail.com wrote: On Tue, Dec 10, 2013 at 9:04 PM, Zack Corr z...@z0w0.me wrote

Re: [rust-dev] Trait container return types

2013-12-15 Thread Ziad Hatahet
Can you have the definition be: fn get_fieldsT(self) - ~[@FieldT];? -- Ziad On Sun, Dec 15, 2013 at 3:13 AM, Andres Osinski andres.osin...@gmail.comwrote: I'll have to consider it. To be honest this is my first endeavor in attempting to capture classic OO business object-y rules using

Re: [rust-dev] RFC: Iterator naming convention

2013-12-21 Thread Ziad Hatahet
I favor this approach too. As an example, Scala does something similar: a call to Map() constructs an immutable map object (it is in the default namespace), whereas if you want a mutable Map object, you have to import it from scala.collection.mutable.Map. -- Ziad On Fri, Dec 20, 2013 at 10:50

Re: [rust-dev] Let’s avoid having both foo() and foo_opt()

2013-12-22 Thread Ziad Hatahet
But we already have Option::unwrap_or() and Option::unwrap_or_else() that behave similar to the 'else' syntax suggested above. -- Ziad On Sun, Dec 22, 2013 at 10:37 AM, Léo Testard leo.test...@gmail.com wrote: Hello, Le 22 déc. 2013 à 18:59, Stefan Plantikow stefan.planti...@gmail.com a

Re: [rust-dev] Rust 0.9 released

2014-01-09 Thread Ziad Hatahet
Zack Corr z...@z0w0.me z...@z0w0.me Ziad Hatahet hata...@gmail.com hata...@gmail.com ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev ___ Rust-dev mailing list

Re: [rust-dev] Chaining Results and Options

2014-02-10 Thread Ziad Hatahet
Isn't this proposal a subset of having `do` syntax like Haskell does? I thought that was being blocked on HKTs. -- Ziad On Mon, Feb 10, 2014 at 4:40 AM, Armin Ronacher armin.ronac...@active-4.com wrote: Hi, On 10/02/2014 11:50, Huon Wilson wrote: It's actually Haskell's fmap, which we

Re: [rust-dev] Virtual fn is a bad idea

2014-03-13 Thread Ziad Hatahet
Kind of off-topic, but there is a heated discussion on the D language forums about why having non-virtual base class methods by default is a bad idea: http://forum.dlang.org/thread/lfqoan$5qq$1...@digitalmars.com Also comes up here:

Re: [rust-dev] Idomatic option handling

2014-03-18 Thread Ziad Hatahet
Hey Phil, That's precisely why I opened the following PR: https://github.com/mozilla/rust/pull/12960 But as Daniel and Alex pointed out, it is pretty redundant. Alex also pointed out that the LLVM optimization pass will optimize away the return value. Scala also allows you to use `for` to deal

[rust-dev] Structural Typing

2014-03-23 Thread Ziad Hatahet
Hi all, Are there any plans to implement structural typing in Rust? Something like this Scala code: http://en.wikipedia.org/wiki/Duck_typing#In_Scala ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] Structural Typing

2014-03-23 Thread Ziad Hatahet
, 2014 at 11:37 AM, Liigo Zhuang com.li...@gmail.comwrote: IMO, this is bad. 2014年3月23日 下午6:34于 Ziad Hatahet hata...@gmail.com写道: Hi all, Are there any plans to implement structural typing in Rust? Something like this Scala code: http://en.wikipedia.org/wiki/Duck_typing#In_Scala

Re: [rust-dev] Structural Typing

2014-03-23 Thread Ziad Hatahet
Thanks for the feedback everyone. It makes sense how things currently are for Rust. Keep up the great work! -- Ziad On Sun, Mar 23, 2014 at 4:54 PM, Liigo Zhuang com.li...@gmail.com wrote: +1 2014年3月24日 上午5:46于 Patrick Walton pcwal...@mozilla.com写道: On 3/23/14 2:19 PM, Ziad Hatahet wrote

Re: [rust-dev] Vector length specified by enum

2014-03-25 Thread Ziad Hatahet
Would a macro address this situation? -- Ziad On Mon, Mar 24, 2014 at 5:12 PM, comex com...@gmail.com wrote: On Mon, Mar 24, 2014 at 7:32 PM, Richo Healey ri...@psych0tik.net wrote: let vec: [u8, .. FooBar::size()]; Potentially with parens ommittted, to convey that there's no runtime

Re: [rust-dev] Reminder: ~[T] is not going away

2014-04-03 Thread Ziad Hatahet
On Thu, Apr 3, 2014 at 11:09 AM, Daniel Micay danielmi...@gmail.com wrote: Go doesn't have an equivalent to what `~[T]` will be. Which was my point. From what I understand, Go's slices are analogous to Rust's VecT in that they are growable. So I was suggesting perusing existing Go code bases

Re: [rust-dev] Removing ~foo

2014-04-15 Thread Ziad Hatahet
On Tue, Apr 15, 2014 at 10:20 AM, Steve Klabnik st...@steveklabnik.comwrote: I can finally retire that bookmark to https://mail.mozilla.org/pipermail/rust-dev/2013-April/003867.html ! How will that change though? Won't we still have to call `.equiv()`? Furthermore, wasn't the plan to use

Re: [rust-dev] Removing ~foo

2014-04-15 Thread Ziad Hatahet
So the new Vec and Str/StrBuf types are all reference types, correct? What happens if we pass around a borrowed or owned pointer to one of these types? Won't there be an extra level of indirection to get to the underlying data pointer? -- Ziad On Tue, Apr 15, 2014 at 11:10 AM, Corey Richardson

Re: [rust-dev] Removing ~foo

2014-04-15 Thread Ziad Hatahet
Would it be worth introducing an own!() macro for this purpose? I came across this suggestion on the reddit thread: http://www.reddit.com/r/rust/comments/2340zb/rustdev_removing_foo/ -- Ziad On Tue, Apr 15, 2014 at 10:12 AM, Patrick Walton pcwal...@mozilla.comwrote: Hi everyone, I'd like to

Re: [rust-dev] possible code dump bug (state machine iterator)

2014-04-18 Thread Ziad Hatahet
Confirm repro on an older rustc version. Ubuntu 13.10 running rustc 0.11-pre (ecc774f 2014-04-11 13:46:45 -0700). -- Ziad On Fri, Apr 18, 2014 at 4:38 AM, Phil Dawes rustp...@phildawes.net wrote: Hello everyone, I was trying to create an iterator that used a function pointer to alternate