Re: [swift-users] Implementing a few statistics functions in Swift

2016-10-10 Thread Harlan Haskins via swift-users
Oh yeah, I'd love contributions and feedback! I'm essentially implementing this as I learn things in stats 101 so it's probably woefully inadequate. 😅 -- Harlan > On Oct 10, 2016, at 1:04 PM, Michael Ilseman wrote: > > >> On Oct 8, 2016, at 11:29 AM, Georgios Moschovitis via swift-users >>

Re: [swift-users] Need Help with C-to-Swift (finally)

2015-12-11 Thread Harlan Haskins via swift-users
Yeah it should finally work when you import CCairo in main.swift. Keep in mind, though, that everyone is volunteering their time on this mailing list. I'm really glad you're taking a liking to Swift, and I'd suggest maybe trying a few things more simple before exercising the finer points of cro

Re: [swift-users] Here's a multi-platform OpenGL loader for Swift.

2015-12-11 Thread Harlan Haskins via swift-users
This is a great use case for multiline string literals! 😅 > On Dec 11, 2015, at 10:56 PM, Joe Groff via swift-users > wrote: > > Nice! Having done OpenGL bindings for other languages, I know this isn't a > trivial task. Giving the functions argument labels is a nice touch. > > -Joe > >> On D

Re: [swift-users] Need Help with C-to-Swift (finally)

2015-12-11 Thread Harlan Haskins via swift-users
Could you push the latest code to GitHub? Sent from my iPhone > On Dec 11, 2015, at 10:42 PM, Gage Morgan wrote: > > Okay, so test.swift is now main.swift, which outputs a much shorter but not > better: > > Compiling Swift Module 'test' (1 sources) > /home/mgage/swift-cairo-bindings/test/main

Re: [swift-users] Need Help with C-to-Swift (finally)

2015-12-11 Thread Harlan Haskins via swift-users
Gotta make sure to make a git tag git tag 1.0.0 git push --tags Sent from my iPhone > On Dec 11, 2015, at 10:29 PM, Gage Morgan wrote: > > Okay, so I've gone in and noticed that yes, it does create a library. How do > I use that? Dependency graph won't check out for some strange reason. > >

Re: [swift-users] Need Help with C-to-Swift (finally)

2015-12-11 Thread Harlan Haskins via swift-users
If they're not the same name, you don't need Cairo.Surface, just Surface. Sent from my iPhone > On Dec 11, 2015, at 9:16 PM, Gage Morgan wrote: > > Here's what I'm getting: > > /home/mgage/swift-cairo-bindings/test/main.swift:4:15: error: module 'Cairo' > has no member named 'Surface' > let s

Re: [swift-users] Need Help with C-to-Swift (finally)

2015-12-11 Thread Harlan Haskins via swift-users
Nope, but you’ll need a way to specify the class inside the module (the fully-qualified type name) Cairo.Cairo should work fine. > On Dec 11, 2015, at 8:14 PM, Gage Morgan wrote: > > The module is Cairo. Do I need to change something (I'm assuming by struct > you mean the name of the class co

Re: [swift-users] Need Help with C-to-Swift (finally)

2015-12-11 Thread Harlan Haskins via swift-users
Is your struct named Cairo or Surface? If Cairo is the module name, you're trying to instantiate the module. - Harlan > On Dec 11, 2015, at 7:55 PM, Gage Morgan wrote: > > How would you use things like cairo.moveTo() outside of the wrapping file? > I've gone as far as writing a module named "

Re: [swift-users] Need Help with C-to-Swift (finally)

2015-12-11 Thread Harlan Haskins via swift-users
I considered that but couldn't find a cairo_get_font_scale function quickly to complement the setter 😅 But yes, a full wrapper would transparently handle getting and setting. - Harlan > On Dec 11, 2015, at 7:28 PM, Jack Lawrence wrote: > > For getter-setter pairs like `setLineWidth`, you migh

Re: [swift-users] Need Help with C-to-Swift (finally)

2015-12-11 Thread Harlan Haskins via swift-users
Gage, Sorry, I just got back from class. I’ll respond in line! > On Dec 11, 2015, at 5:09 PM, Gage Morgan wrote: > > Harlan, > > I read on cairographics.org about bindings awhile > back. I think they want cairo, not surface, so we would have something like: > > l

Re: [swift-users] Need Help with C-to-Swift (finally)

2015-12-11 Thread Harlan Haskins via swift-users
So, it’s a very simple almost one-to-one translation of that C code block to Swift. You have to make sure to import CCairo at the beginning of the file, and change the variable declarations to use let instead of the C declaration. This works for me, as is. import CCairo let surface = cairo_ima

Re: [swift-users] Text editor

2015-12-10 Thread Harlan Haskins via swift-users
https://github.com/harlanhaskins/swift#developing-swift-in-xcode > On Dec 10, 2015, at 12:10 PM, Stephen Celis wrote: > > Is there an Xcode project file that makes building/debugging easier? > > Stephen > > On Thu, Dec 10, 2015 at 11:55 AM, Harlan Haskins via swift-users

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Harlan Haskins via swift-users
IIRC this isn’t possible because there’s no Runtime to query for classnames (it’s inherently unsafe anyway). You might want to look into a better way of doing that you’re trying to do. — Harlan > On Dec 10, 2015, at 12:42 AM, Matthew Davies via swift-users > wrote: > > I am using the Swift b

Re: [swift-users] Binding Regular C Functions (Gtk, Cairo, etc.)

2015-12-08 Thread Harlan Haskins via swift-users
Just covering all the bases here: did you commit and add Package.swift before making the tag? Sent from my iPhone > On Dec 8, 2015, at 11:08 PM, Jason Dusek via swift-users > wrote: > > Gage, > > For what it's worth, after running `git init` and `git tag -f 1.0.0` > in `CCairo` to get someth

Re: [swift-users] Ignore header file with module?

2015-12-07 Thread Harlan Haskins via swift-users
Is there a way I can tell this not to compile with the OS X SDK? The C library is responsible for including all the headers it needs. > On Dec 4, 2015, at 7:15 PM, Harlan Haskins wrote: > > So what happens is flipper.h declares a struct called `flash`. When I use > `swift build` to build that

Re: [swift-users] Swift Package website

2015-12-06 Thread Harlan Haskins via swift-users
actual index and those features being designed and developed, >> I agree it would be cool if someone started an informal index (maybe in the >> vein of the https://github.com/sindresorhus/awesome style repos?). >> >> - Daniel >> >>> On Dec 5, 2015, at 4:49 PM