src/scripts/swigwin/Source/Modules/cffi.cxx
String *CFFI::lispy_name(char *name) {
  bool helper = false;
  String *new_name = NewString("");
  for (unsigned int i = 0; i < strlen(name); i++) {
    if (name[i] == '_' || name[i] == '-') {
      Printf(new_name, "%c", '-');
      helper = false;
    } else if (name[i] >= 'A' && name[i] <= 'Z') {
      if (helper)
  Printf(new_name, "%c", '-');
      Printf(new_name, "%c", ('a' + (name[i] - 'A')));
      helper = false;
    } else {
      helper = true;
      Printf(new_name, "%c", name[i]);
    }
  }
  return new_name;
}
//less flexible as it does the conversion in C, the lispify name does the conversion in lisp
less flexible as it does the conversion in C, the lispify name does the conversion in lisp
less flexible as it does the conversion in C the lispify name does the conversion in lisp
String *CFFI::lispy_name(char *name) {
  bool helper = false;
  String *new_name = NewString("");
  for (unsigned int i = 0; i < strlen(name); i++) {
    if (name[i] == '_' || name[i] == '-') {
      Printf(new_name, "%c", '-');
      helper = false;
    } else if (name[i] >= 'A' && name[i] <= 'Z') {
      if (helper)
  Printf(new_name, "%c", '-');
      Printf(new_name, "%c", ('a' + (name[i] - 'A')));
      helper = false;
    } else {
      helper = true;
      Printf(new_name, "%c", name[i]);
    }
  }
  return new_name;
}
String * CFFI :: lispy_name ( char * name ) { bool helper = false ; String * new_name = NewString ( " " ) ; for ( unsigned int i = 0 ; i < strlen ( name ) ; i ++ ) { if ( name [ i ] == ' ' || name [ i ] == ' ' ) { Printf ( new_name , " " , ' ' ) ; helper = false ; } else if ( name [ i ] >= ' ' && name [ i ] <= ' ' ) { if ( helper ) Printf ( new_name , " " , ' ' ) ; Printf ( new_name , " " , ( ' ' + ( name [ i ] - ' ' ) ) ) ; helper = false ; } else { helper = true ; Printf ( new_name , " " , name [ i ] ) ; } } return new_name ; }
less flexible as it does the conversion in C, the lispify name does the conversion in lisp
less flexible as it does the conversion in C the lispify name does the conversion in lisp