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
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
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
> 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.
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
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
@mashinagan
Alright alright
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:
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?