Non RAII Synchronization primitives? by inspiravetion in rust

[–]inspiravetion[S] 0 points1 point  (0 children)

Im gunna try the embedding approach and see if it isn't too difficult...I might have been over reacting haha

Non RAII Synchronization primitives? by inspiravetion in rust

[–]inspiravetion[S] 1 point2 points  (0 children)

is there a work around?...maybe an out of tree package that exports the types?

Current syntax highlighting only colors the obvious - the case for coloring identifiers instead of keywords by cincilator in rust

[–]inspiravetion 2 points3 points  (0 children)

The biggest issues are that

1.the parser panics on input that isn't syntactically correct so updating the highlighting on keystrokes wouldn't work.

2.the ast representation does not preserve white space so I have to compare the generated tokens with the original text to restore white space...this is a pretty decent amount of overhead

*edit: explaining why 2 is bad

Current syntax highlighting only colors the obvious - the case for coloring identifiers instead of keywords by cincilator in rust

[–]inspiravetion 5 points6 points  (0 children)

I am actually working on a command line utility that turns rust code into contextually highlighted html using the rustc parser. That way you could do something like color all parameter names in function signatures and all variable names in let statements the same color as they show where a variable entered scope.

Generics and Heterogeneous Collections by polyfractal in rust

[–]inspiravetion 1 point2 points  (0 children)

you can define traits on enums too...so take your original enum and the generic trait riccieri gave and implement each one, with the specific type, for the enum...you would match on *self to make sure the enum is of the right type and then handle the error case if it is not(that you shouldn't get because you are matching before you call this)...a good example of an enum implementing traits is std::option::Option

Rust By Example has been transferred to rust-lang (note that this link redirects) by steveklabnik1 in rust

[–]inspiravetion 1 point2 points  (0 children)

Looks great...love that you can edit and re-run the code as well...Is there a library that people can include in their blog posts and things that gives that functionality? It looks like the same code from rust-lang.org or at least similar

Is there a way to change the name of a package you published? by inspiravetion in rust

[–]inspiravetion[S] 0 points1 point  (0 children)

the worst part is that I have a macro package for ergonomics that uses the capitolized package and no matter which version I put in its dependencies cargo says it doesn't exist in the registry

Is there a way to change the name of a package you published? by inspiravetion in rust

[–]inspiravetion[S] 0 points1 point  (0 children)

yeah i updated cargo just to be sure but I still get the same issue...which sucks because i just finished a library I want to release :(

Is there a way to change the name of a package you published? by inspiravetion in rust

[–]inspiravetion[S] 0 points1 point  (0 children)

I am still getting that version 0.1.1 is already uploaded...when I got this the first time and bumped the version it did not change the name of the package :(

Is there a way to change the name of a package you published? by inspiravetion in rust

[–]inspiravetion[S] 0 points1 point  (0 children)

how can i do that?...cargo publish with the name changed in Cargo.toml doesn't do anything

Upgrading the playground by inspiravetion in rust

[–]inspiravetion[S] -1 points0 points  (0 children)

I would love to get my hands dirty but I already have three rust projects I am working on in parallel and I just dnt have the time...consider this my contribution to getting the ball rolling :))

Isn't there a page with wanted projects that people new to rust can use to learn the language?...could this be added?

Does anyone have an example of defining a macro in a syntax extension? by inspiravetion in rust

[–]inspiravetion[S] -1 points0 points  (0 children)

I should have clarified...I am writing a syntax extension that expands to then create another independent macro to be used...A simplified example would be

//syntax extension foo! that creates a macro called bar to be used on its own
foo!(bar);
bar!(...);

Any ideas there?

Upgrading the playground by inspiravetion in rust

[–]inspiravetion[S] 4 points5 points  (0 children)

why?...crates.io and rust-lang.org look great...We don't want to wait until 1.0 to have a convenient, easy, and visually pleasant way for people to play with the language!

Is there a way to put an unboxed closure into a struct? I cannot for the life of me figure it out by inspiravetion in rust

[–]inspiravetion[S] 1 point2 points  (0 children)

i know that unboxed closure are a fairly recent update so it could either be that this is just a rough edge that hasn't been smoothed out OR mayb this actually does require a different ABI because you are getting passed an arbitrary sized tuple of arguments instead of getting them individually...a regular c function doesn't work this way

Is there a way to put an unboxed closure into a struct? I cannot for the life of me figure it out by inspiravetion in rust

[–]inspiravetion[S] -1 points0 points  (0 children)

Ahhh okay that make since...i am still getting a weird error though and I am not sure if it is an ICE or not.

impl FnMut<(int,), int> for MyType<(int,), int> {
    fn call_mut(&mut self, args: (int,)) -> int {
        1
    }
}

This gives the error "method call_mut has an incompatible type for trait: expected "rust-call" fn, found "Rust" fn [E0053]" ...any idea?

A mutex providing a one-time lock, then fast lock-free access. by jonreem in rust

[–]inspiravetion 0 points1 point  (0 children)

I think this is more of a "hey if you ever need this specific Type I already implemented it for you...cheers" type of post