Re: A question about importcpp and closure

2017-03-07 Thread mashingan
Try this: {.emit: """/*TYPESECTION*/ class Foo{}; """.} type Foo {.importcpp: "Foo", nodecl.} = object proc hello(_: Foo) = echo "Hello" proc foo (call: proc(_: Foo)) = call Foo() foo hello

Re: Cannot import a file that has importcpp? Codegen issue?

2017-03-07 Thread ggibson
Resolved. I didn't not understand when to use importc vs importcpp. Apparently importcpp is ONLY for methods of classes. If I change my pragma to importc then everything is fine. -From docs/backends.html- "The importc pragma is the generic way of making backend symbols avail

Re: Enums pure & namespaced by default

2017-03-07 Thread Trustable
I think pure enums should be default because of these advantages: * more beginner friendly * the name of enum elements is simpler and easier to guess, because it doesn't need a prefix (or in other words: the prefix is always the name of the type) * maybe more intelligent auto-completion in

Re: Enums pure & namespaced by default

2017-03-07 Thread Arrrrrrrrr
> Also .pure enums beg for further features like SomeEnum.{ValueA, ValueB} as a > shortcut for {SomeEnum.ValueA, SomeEnum.ValueB} etc. This really should be a thing. Like gmpreussner said, non-pure enums are a pain when you make a heavy use of them.

Re: Enums pure & namespaced by default

2017-03-07 Thread balmerhevi
This will help you to know more about Java Enum [http://net-informations.com/java/basics/enum.htm](http://net-informations.com/java/basics/enum.htm) Balmer

Cannot import a file that has importcpp? Codegen issue?

2017-03-07 Thread ggibson
Hi, this looks like a codegen issue, but wanted to ask as I might be missing something simple. The code will only run if the type declaration is removed from the first file. Tested on: * 0.16.1 (devel) * 0.16.0 (master) File1: importme.nim ## Random Device from C++ typ

Re: A question on job

2017-03-07 Thread Fungi
@mashinagan Alright alright

A question about importcpp and closure

2017-03-07 Thread LinGo
I'm trying to write some code. Does it mean I can't write it like this? {.emit: """ class Foo {}; """.} type Foo {.importcpp: "Foo".} = object proc hello(_: Foo) = echo "hello" proc foo(call: proc (_: Foo)) = call Foo() error:

Re: Nimgame 2

2017-03-07 Thread zetashift
How would I draw a box and use it as the entity graphic? Currently have a ProcGraphix which calls the box() proc. Any nicer way to do this?