Menu

DATA_OBJECT for SetDefglobalValue?

Help
2009-01-22
2012-11-23
  • White Flame

    White Flame - 2009-01-22

    In the Advanced Programming Guide, there's no mention that I can find for how to actually create a DATA_OBJECT to pass to SetDefglobalValue.  DATA_OBJECTs seem to be managed by the garbage collector, so I don't want to just malloc one and stuff it in without knowing that's expected.

    I'm working on a SWIG target for CLIPS, and I want to expose constants as globals.  I've got the other basics working in SWIG so far.

    Thanks!

     
    • Gary Riley

      Gary Riley - 2009-01-23

      Just statically allocate a DATA_OBJECT in your function

      DATA_OBJECT theDO;

      /* Your code here to assign type and value to theDO */

      SetDefglobalValue("yourGlobal",&theDO);

       
    • White Flame

      White Flame - 2009-01-24

      Ah, so it's copy semantics.  Thanks!

       

Log in to post a comment.