Does Ruby have an equivalent to Python's ctypes?

Discussion in 'Ruby' started by Shadowfirebird, Nov 10, 2010.

  1.  
    Shadowfirebird, Nov 10, 2010
    #1
    1. Advertisements

  2. From the description I found of ctypes, I think ffi
    <https://github.com/ffi/ffi> would be close. Perhaps if you give us
    more information about what you want to do, we can give you more
    specific recommendations.
     
    Eric Christopherson, Nov 10, 2010
    #2
    1. Advertisements

  3. Shadowfirebird

    Ammar Ali Guest

    Ammar Ali, Nov 10, 2010
    #3
  4. Daniel Berger, Nov 11, 2010
    #4
  5. Shadowfirebird

    Ammar Ali Guest

    Given how easy it is to implement this type functionality in pure
    ruby, do you really want the added dependency? Especially on a gem
    that's still in beat, hasn't been touched since 2005, and requires a
    compiler (sure, no big deal, but character types are not worth all
    that ceremony). I stumbled across this gem when I was searching for
    ctype functionality (http://www.ruby-forum.com/topic/329485) and
    decided that it wasn't worth it.

    If you need the methods to be callable on Strings, it's easy to do so.
    Also, if you want the functionality to handle Unicode characters,
    doing it in pure ruby, using regular expressions, is much easier.

    Regards,
    Ammar
     
    Ammar Ali, Nov 11, 2010
    #5
  6.  
    Shadowfirebird, Nov 11, 2010
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.