Home | History | Annotate | Download | only in guile
      1 /* -----------------------------------------------------------------------------
      2  * std_pair.i
      3  *
      4  * SWIG typemaps for std::pair
      5  * ----------------------------------------------------------------------------- */
      6 
      7 %include <std_common.i>
      8 %include <exception.i>
      9 
     10 // ------------------------------------------------------------------------
     11 // std::pair
     12 //
     13 // See std_vector.i for the rationale of typemap application
     14 // ------------------------------------------------------------------------
     15 
     16 %{
     17 #include <utility>
     18 %}
     19 
     20 // exported class
     21 
     22 namespace std {
     23 
     24     template<class T, class U> struct pair {
     25         %typemap(in) pair<T,U> %{
     26             if (scm_is_pair($input)) {
     27                 T* x;
     28                 U* y;
     29                 SCM first, second;
     30                 first = SCM_CAR($input);
     31                 second = SCM_CDR($input);
     32                 x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0);
     33                 y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0);
     34                 $1 = std::make_pair(*x,*y);
     35             } else {
     36                 $1 = *(($&1_type)
     37                        SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
     38             }
     39         %}
     40         %typemap(in) const pair<T,U>& (std::pair<T,U> *temp = 0),
     41                      const pair<T,U>* (std::pair<T,U> *temp = 0) %{
     42             if (scm_is_pair($input)) {
     43                 T* x;
     44                 U* y;
     45                 SCM first, second;
     46                 first = SCM_CAR($input);
     47                 second = SCM_CDR($input);
     48                 x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0);
     49                 y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0);
     50                 temp = new std::pair< T, U >(*x,*y);
     51                 $1 = temp;
     52             } else {
     53                 $1 = ($1_ltype)
     54                     SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
     55             }
     56         %}
     57         %typemap(freearg) const pair<T,U>&, const pair<T,U>* %{ delete temp$argnum; %}
     58         %typemap(out) pair<T,U> {
     59             T* x = new T($1.first);
     60             U* y = new U($1.second);
     61             SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1);
     62             SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1);
     63             $result = scm_cons(first,second);
     64         }
     65         %typecheck(SWIG_TYPECHECK_PAIR) pair<T,U> {
     66             /* native pair? */
     67             if (scm_is_pair($input)) {
     68                 T* x;
     69                 U* y;
     70                 SCM first = SCM_CAR($input);
     71                 SCM second = SCM_CDR($input);
     72                 if (SWIG_ConvertPtr(first,(void**) &x,
     73                                     $descriptor(T *), 0) == 0 &&
     74                     SWIG_ConvertPtr(second,(void**) &y,
     75                                     $descriptor(U *), 0) == 0) {
     76                     $1 = 1;
     77                 } else {
     78                     $1 = 0;
     79                 }
     80             } else {
     81                 /* wrapped pair? */
     82                 std::pair<T,U >* m;
     83                 if (SWIG_ConvertPtr($input,(void **) &m,
     84                                     $&1_descriptor, 0) == 0)
     85                     $1 = 1;
     86                 else
     87                     $1 = 0;
     88             }
     89         }
     90         %typecheck(SWIG_TYPECHECK_PAIR) const pair<T,U>&,
     91                                         const pair<T,U>* {
     92             /* native pair? */
     93             if (scm_is_pair($input)) {
     94                 T* x;
     95                 U* y;
     96                 SCM first = SCM_CAR($input);
     97                 SCM second = SCM_CDR($input);
     98                 if (SWIG_ConvertPtr(first,(void**) &x,
     99                                     $descriptor(T *), 0) == 0 &&
    100                     SWIG_ConvertPtr(second,(void**) &y,
    101                                     $descriptor(U *), 0) == 0) {
    102                     $1 = 1;
    103                 } else {
    104                     $1 = 0;
    105                 }
    106             } else {
    107                 /* wrapped pair? */
    108                 std::pair<T,U >* m;
    109                 if (SWIG_ConvertPtr($input,(void **) &m,
    110                                     $1_descriptor, 0) == 0)
    111                     $1 = 1;
    112                 else
    113                     $1 = 0;
    114             }
    115         }
    116         pair();
    117         pair(T first, U second);
    118         pair(const pair& p);
    119 
    120         template <class U1, class U2> pair(const pair<U1, U2> &p);
    121 
    122         T first;
    123         U second;
    124     };
    125 
    126 
    127     // specializations for built-ins
    128 
    129     %define specialize_std_pair_on_first(T,CHECK,CONVERT_FROM,CONVERT_TO)
    130     template<class U> struct pair<T,U> {
    131         %typemap(in) pair<T,U> %{
    132             if (scm_is_pair($input)) {
    133                 U* y;
    134                 SCM first, second;
    135                 first = SCM_CAR($input);
    136                 second = SCM_CDR($input);
    137                 if (!CHECK(first))
    138                     SWIG_exception(SWIG_TypeError,
    139                                    "pair<" #T "," #U "> expected");
    140                 y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0);
    141                 $1 = std::make_pair(CONVERT_FROM(first),*y);
    142             } else {
    143                 $1 = *(($&1_type)
    144                        SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
    145             }
    146         %}
    147         %typemap(in) const pair<T,U>& (std::pair<T,U> *temp = 0),
    148                      const pair<T,U>* (std::pair<T,U> *temp = 0) %{
    149             if (scm_is_pair($input)) {
    150                 U* y;
    151                 SCM first, second;
    152                 first = SCM_CAR($input);
    153                 second = SCM_CDR($input);
    154                 if (!CHECK(first))
    155                     SWIG_exception(SWIG_TypeError,
    156                                    "pair<" #T "," #U "> expected");
    157                 y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0);
    158                 temp = new std::pair< T, U >(CONVERT_FROM(first),*y);
    159                 $1 = temp;
    160             } else {
    161                 $1 = ($1_ltype)
    162                     SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
    163             }
    164         %}
    165         %typemap(freearg) const pair<T,U>&, const pair<T,U>* %{ delete temp$argnum; %}
    166         %typemap(out) pair<T,U> {
    167             U* y = new U($1.second);
    168             SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1);
    169             $result = scm_cons(CONVERT_TO($1.first),second);
    170         }
    171         %typecheck(SWIG_TYPECHECK_PAIR) pair<T,U> {
    172             /* native pair? */
    173             if (scm_is_pair($input)) {
    174                 U* y;
    175                 SCM first = SCM_CAR($input);
    176                 SCM second = SCM_CDR($input);
    177                 if (CHECK(first) &&
    178                     SWIG_ConvertPtr(second,(void**) &y,
    179                                     $descriptor(U *), 0) == 0) {
    180                     $1 = 1;
    181                 } else {
    182                     $1 = 0;
    183                 }
    184             } else {
    185                 /* wrapped pair? */
    186                 std::pair<T,U >* m;
    187                 if (SWIG_ConvertPtr($input,(void **) &m,
    188                                     $&1_descriptor, 0) == 0)
    189                     $1 = 1;
    190                 else
    191                     $1 = 0;
    192             }
    193         }
    194         %typecheck(SWIG_TYPECHECK_PAIR) const pair<T,U>&,
    195                                         const pair<T,U>* {
    196             /* native pair? */
    197             if (scm_is_pair($input)) {
    198                 U* y;
    199                 SCM first = SCM_CAR($input);
    200                 SCM second = SCM_CDR($input);
    201                 if (CHECK(first) &&
    202                     SWIG_ConvertPtr(second,(void**) &y,
    203                                     $descriptor(U *), 0) == 0) {
    204                     $1 = 1;
    205                 } else {
    206                     $1 = 0;
    207                 }
    208             } else {
    209                 /* wrapped pair? */
    210                 std::pair<T,U >* m;
    211                 if (SWIG_ConvertPtr($input,(void **) &m,
    212                                     $1_descriptor, 0) == 0)
    213                     $1 = 1;
    214                 else
    215                     $1 = 0;
    216             }
    217         }
    218         pair();
    219         pair(T first, U second);
    220         pair(const pair& p);
    221 
    222         template <class U1, class U2> pair(const pair<U1, U2> &p);
    223 
    224         T first;
    225         U second;
    226     };
    227     %enddef
    228 
    229     %define specialize_std_pair_on_second(U,CHECK,CONVERT_FROM,CONVERT_TO)
    230     template<class T> struct pair<T,U> {
    231         %typemap(in) pair<T,U> %{
    232             if (scm_is_pair($input)) {
    233                 T* x;
    234                 SCM first, second;
    235                 first = SCM_CAR($input);
    236                 second = SCM_CDR($input);
    237                 x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0);
    238                 if (!CHECK(second))
    239                     SWIG_exception(SWIG_TypeError,
    240                                    "pair<" #T "," #U "> expected");
    241                 $1 = std::make_pair(*x,CONVERT_FROM(second));
    242             } else {
    243                 $1 = *(($&1_type)
    244                        SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
    245             }
    246         %}
    247         %typemap(in) const pair<T,U>& (std::pair<T,U> *temp = 0),
    248                      const pair<T,U>* (std::pair<T,U> *temp = 0) %{
    249             if (scm_is_pair($input)) {
    250                 T* x;
    251                 SCM first, second;
    252                 first = SCM_CAR($input);
    253                 second = SCM_CDR($input);
    254                 x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0);
    255                 if (!CHECK(second))
    256                     SWIG_exception(SWIG_TypeError,
    257                                    "pair<" #T "," #U "> expected");
    258                 temp = new std::pair< T, U >(*x,CONVERT_FROM(second));
    259                 $1 = temp;
    260             } else {
    261                 $1 = ($1_ltype)
    262                     SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
    263             }
    264         %}
    265         %typemap(freearg) const pair<T,U>&, const pair<T,U>* %{ delete temp$argnum; %}
    266         %typemap(out) pair<T,U> {
    267             T* x = new T($1.first);
    268             SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1);
    269             $result = scm_cons(first,CONVERT_TO($1.second));
    270         }
    271         %typecheck(SWIG_TYPECHECK_PAIR) pair<T,U> {
    272             /* native pair? */
    273             if (scm_is_pair($input)) {
    274                 T* x;
    275                 SCM first = SCM_CAR($input);
    276                 SCM second = SCM_CDR($input);
    277                 if (SWIG_ConvertPtr(first,(void**) &x,
    278                                     $descriptor(T *), 0) == 0 &&
    279                     CHECK(second)) {
    280                     $1 = 1;
    281                 } else {
    282                     $1 = 0;
    283                 }
    284             } else {
    285                 /* wrapped pair? */
    286                 std::pair<T,U >* m;
    287                 if (SWIG_ConvertPtr($input,(void **) &m,
    288                                     $&1_descriptor, 0) == 0)
    289                     $1 = 1;
    290                 else
    291                     $1 = 0;
    292             }
    293         }
    294         %typecheck(SWIG_TYPECHECK_PAIR) const pair<T,U>&,
    295                                         const pair<T,U>* {
    296             /* native pair? */
    297             if (scm_is_pair($input)) {
    298                 T* x;
    299                 SCM first = SCM_CAR($input);
    300                 SCM second = SCM_CDR($input);
    301                 if (SWIG_ConvertPtr(first,(void**) &x,
    302                                     $descriptor(T *), 0) == 0 &&
    303                     CHECK(second)) {
    304                     $1 = 1;
    305                 } else {
    306                     $1 = 0;
    307                 }
    308             } else {
    309                 /* wrapped pair? */
    310                 std::pair<T,U >* m;
    311                 if (SWIG_ConvertPtr($input,(void **) &m,
    312                                     $1_descriptor, 0) == 0)
    313                     $1 = 1;
    314                 else
    315                     $1 = 0;
    316             }
    317         }
    318         pair();
    319         pair(T first, U second);
    320         pair(const pair& p);
    321 
    322         template <class U1, class U2> pair(const pair<U1, U2> &p);
    323 
    324         T first;
    325         U second;
    326     };
    327     %enddef
    328 
    329     %define specialize_std_pair_on_both(T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO,
    330                                         U,CHECK_U,CONVERT_U_FROM,CONVERT_U_TO)
    331     template<> struct pair<T,U> {
    332         %typemap(in) pair<T,U> %{
    333             if (scm_is_pair($input)) {
    334                 SCM first, second;
    335                 first = SCM_CAR($input);
    336                 second = SCM_CDR($input);
    337                 if (!CHECK_T(first) || !CHECK_U(second))
    338                     SWIG_exception(SWIG_TypeError,
    339                                    "pair<" #T "," #U "> expected");
    340                 $1 = std::make_pair(CONVERT_T_FROM(first),
    341                                     CONVERT_U_FROM(second));
    342             } else {
    343                 $1 = *(($&1_type)
    344                        SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
    345             }
    346         %}
    347         %typemap(in) const pair<T,U>& (std::pair<T,U> *temp = 0),
    348                      const pair<T,U>* (std::pair<T,U> *temp = 0) %{
    349             if (scm_is_pair($input)) {
    350                 SCM first, second;
    351                 first = SCM_CAR($input);
    352                 second = SCM_CDR($input);
    353                 if (!CHECK_T(first) || !CHECK_U(second))
    354                     SWIG_exception(SWIG_TypeError,
    355                                    "pair<" #T "," #U "> expected");
    356                 temp = new std::pair< T, U >(CONVERT_T_FROM(first), CONVERT_U_FROM(second));
    357                 $1 = temp;
    358             } else {
    359                 $1 = ($1_ltype)
    360                     SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
    361             }
    362         %}
    363         %typemap(freearg) const pair<T,U>&, const pair<T,U>* %{ delete temp$argnum; %}
    364         %typemap(out) pair<T,U> {
    365             $result = scm_cons(CONVERT_T_TO($1.first),
    366                               CONVERT_U_TO($1.second));
    367         }
    368         %typecheck(SWIG_TYPECHECK_PAIR) pair<T,U> {
    369             /* native pair? */
    370             if (scm_is_pair($input)) {
    371                 SCM first = SCM_CAR($input);
    372                 SCM second = SCM_CDR($input);
    373                 if (CHECK_T(first) && CHECK_U(second)) {
    374                     $1 = 1;
    375                 } else {
    376                     $1 = 0;
    377                 }
    378             } else {
    379                 /* wrapped pair? */
    380                 std::pair<T,U >* m;
    381                 if (SWIG_ConvertPtr($input,(void **) &m,
    382                                     $&1_descriptor, 0) == 0)
    383                     $1 = 1;
    384                 else
    385                     $1 = 0;
    386             }
    387         }
    388         %typecheck(SWIG_TYPECHECK_PAIR) const pair<T,U>&,
    389                                         const pair<T,U>* {
    390             /* native pair? */
    391             if (scm_is_pair($input)) {
    392                 SCM first = SCM_CAR($input);
    393                 SCM second = SCM_CDR($input);
    394                 if (CHECK_T(first) && CHECK_U(second)) {
    395                     $1 = 1;
    396                 } else {
    397                     $1 = 0;
    398                 }
    399             } else {
    400                 /* wrapped pair? */
    401                 std::pair<T,U >* m;
    402                 if (SWIG_ConvertPtr($input,(void **) &m,
    403                                     $1_descriptor, 0) == 0)
    404                     $1 = 1;
    405                 else
    406                     $1 = 0;
    407             }
    408         }
    409         pair();
    410         pair(T first, U second);
    411         pair(const pair& p);
    412 
    413         template <class U1, class U2> pair(const pair<U1, U2> &p);
    414 
    415         T first;
    416         U second;
    417     };
    418     %enddef
    419 
    420 
    421     specialize_std_pair_on_first(bool,scm_is_bool,
    422                               scm_is_true,SWIG_bool2scm);
    423     specialize_std_pair_on_first(int,scm_is_number,
    424                               scm_to_long,scm_from_long);
    425     specialize_std_pair_on_first(short,scm_is_number,
    426                               scm_to_long,scm_from_long);
    427     specialize_std_pair_on_first(long,scm_is_number,
    428                               scm_to_long,scm_from_long);
    429     specialize_std_pair_on_first(unsigned int,scm_is_number,
    430                               scm_to_ulong,scm_from_ulong);
    431     specialize_std_pair_on_first(unsigned short,scm_is_number,
    432                               scm_to_ulong,scm_from_ulong);
    433     specialize_std_pair_on_first(unsigned long,scm_is_number,
    434                               scm_to_ulong,scm_from_ulong);
    435     specialize_std_pair_on_first(double,scm_is_number,
    436                               scm_to_double,scm_from_double);
    437     specialize_std_pair_on_first(float,scm_is_number,
    438                               scm_to_double,scm_from_double);
    439     specialize_std_pair_on_first(std::string,scm_is_string,
    440                               SWIG_scm2string,SWIG_string2scm);
    441 
    442     specialize_std_pair_on_second(bool,scm_is_bool,
    443                                 scm_is_true,SWIG_bool2scm);
    444     specialize_std_pair_on_second(int,scm_is_number,
    445                                 scm_to_long,scm_from_long);
    446     specialize_std_pair_on_second(short,scm_is_number,
    447                                 scm_to_long,scm_from_long);
    448     specialize_std_pair_on_second(long,scm_is_number,
    449                                 scm_to_long,scm_from_long);
    450     specialize_std_pair_on_second(unsigned int,scm_is_number,
    451                                 scm_to_ulong,scm_from_ulong);
    452     specialize_std_pair_on_second(unsigned short,scm_is_number,
    453                                 scm_to_ulong,scm_from_ulong);
    454     specialize_std_pair_on_second(unsigned long,scm_is_number,
    455                                 scm_to_ulong,scm_from_ulong);
    456     specialize_std_pair_on_second(double,scm_is_number,
    457                                 scm_to_double,scm_from_double);
    458     specialize_std_pair_on_second(float,scm_is_number,
    459                                 scm_to_double,scm_from_double);
    460     specialize_std_pair_on_second(std::string,scm_is_string,
    461                                 SWIG_scm2string,SWIG_string2scm);
    462 
    463     specialize_std_pair_on_both(bool,scm_is_bool,
    464                                scm_is_true,SWIG_bool2scm,
    465                                bool,scm_is_bool,
    466                                scm_is_true,SWIG_bool2scm);
    467     specialize_std_pair_on_both(bool,scm_is_bool,
    468                                scm_is_true,SWIG_bool2scm,
    469                                int,scm_is_number,
    470                                scm_to_long,scm_from_long);
    471     specialize_std_pair_on_both(bool,scm_is_bool,
    472                                scm_is_true,SWIG_bool2scm,
    473                                short,scm_is_number,
    474                                scm_to_long,scm_from_long);
    475     specialize_std_pair_on_both(bool,scm_is_bool,
    476                                scm_is_true,SWIG_bool2scm,
    477                                long,scm_is_number,
    478                                scm_to_long,scm_from_long);
    479     specialize_std_pair_on_both(bool,scm_is_bool,
    480                                scm_is_true,SWIG_bool2scm,
    481                                unsigned int,scm_is_number,
    482                                scm_to_ulong,scm_from_ulong);
    483     specialize_std_pair_on_both(bool,scm_is_bool,
    484                                scm_is_true,SWIG_bool2scm,
    485                                unsigned short,scm_is_number,
    486                                scm_to_ulong,scm_from_ulong);
    487     specialize_std_pair_on_both(bool,scm_is_bool,
    488                                scm_is_true,SWIG_bool2scm,
    489                                unsigned long,scm_is_number,
    490                                scm_to_ulong,scm_from_ulong);
    491     specialize_std_pair_on_both(bool,scm_is_bool,
    492                                scm_is_true,SWIG_bool2scm,
    493                                double,scm_is_number,
    494                                scm_to_double,scm_from_double);
    495     specialize_std_pair_on_both(bool,scm_is_bool,
    496                                scm_is_true,SWIG_bool2scm,
    497                                float,scm_is_number,
    498                                scm_to_double,scm_from_double);
    499     specialize_std_pair_on_both(bool,scm_is_bool,
    500                                scm_is_true,SWIG_bool2scm,
    501                                std::string,scm_is_string,
    502                                SWIG_scm2string,SWIG_string2scm);
    503     specialize_std_pair_on_both(int,scm_is_number,
    504                                scm_to_long,scm_from_long,
    505                                bool,scm_is_bool,
    506                                scm_is_true,SWIG_bool2scm);
    507     specialize_std_pair_on_both(int,scm_is_number,
    508                                scm_to_long,scm_from_long,
    509                                int,scm_is_number,
    510                                scm_to_long,scm_from_long);
    511     specialize_std_pair_on_both(int,scm_is_number,
    512                                scm_to_long,scm_from_long,
    513                                short,scm_is_number,
    514                                scm_to_long,scm_from_long);
    515     specialize_std_pair_on_both(int,scm_is_number,
    516                                scm_to_long,scm_from_long,
    517                                long,scm_is_number,
    518                                scm_to_long,scm_from_long);
    519     specialize_std_pair_on_both(int,scm_is_number,
    520                                scm_to_long,scm_from_long,
    521                                unsigned int,scm_is_number,
    522                                scm_to_ulong,scm_from_ulong);
    523     specialize_std_pair_on_both(int,scm_is_number,
    524                                scm_to_long,scm_from_long,
    525                                unsigned short,scm_is_number,
    526                                scm_to_ulong,scm_from_ulong);
    527     specialize_std_pair_on_both(int,scm_is_number,
    528                                scm_to_long,scm_from_long,
    529                                unsigned long,scm_is_number,
    530                                scm_to_ulong,scm_from_ulong);
    531     specialize_std_pair_on_both(int,scm_is_number,
    532                                scm_to_long,scm_from_long,
    533                                double,scm_is_number,
    534                                scm_to_double,scm_from_double);
    535     specialize_std_pair_on_both(int,scm_is_number,
    536                                scm_to_long,scm_from_long,
    537                                float,scm_is_number,
    538                                scm_to_double,scm_from_double);
    539     specialize_std_pair_on_both(int,scm_is_number,
    540                                scm_to_long,scm_from_long,
    541                                std::string,scm_is_string,
    542                                SWIG_scm2string,SWIG_string2scm);
    543     specialize_std_pair_on_both(short,scm_is_number,
    544                                scm_to_long,scm_from_long,
    545                                bool,scm_is_bool,
    546                                scm_is_true,SWIG_bool2scm);
    547     specialize_std_pair_on_both(short,scm_is_number,
    548                                scm_to_long,scm_from_long,
    549                                int,scm_is_number,
    550                                scm_to_long,scm_from_long);
    551     specialize_std_pair_on_both(short,scm_is_number,
    552                                scm_to_long,scm_from_long,
    553                                short,scm_is_number,
    554                                scm_to_long,scm_from_long);
    555     specialize_std_pair_on_both(short,scm_is_number,
    556                                scm_to_long,scm_from_long,
    557                                long,scm_is_number,
    558                                scm_to_long,scm_from_long);
    559     specialize_std_pair_on_both(short,scm_is_number,
    560                                scm_to_long,scm_from_long,
    561                                unsigned int,scm_is_number,
    562                                scm_to_ulong,scm_from_ulong);
    563     specialize_std_pair_on_both(short,scm_is_number,
    564                                scm_to_long,scm_from_long,
    565                                unsigned short,scm_is_number,
    566                                scm_to_ulong,scm_from_ulong);
    567     specialize_std_pair_on_both(short,scm_is_number,
    568                                scm_to_long,scm_from_long,
    569                                unsigned long,scm_is_number,
    570                                scm_to_ulong,scm_from_ulong);
    571     specialize_std_pair_on_both(short,scm_is_number,
    572                                scm_to_long,scm_from_long,
    573                                double,scm_is_number,
    574                                scm_to_double,scm_from_double);
    575     specialize_std_pair_on_both(short,scm_is_number,
    576                                scm_to_long,scm_from_long,
    577                                float,scm_is_number,
    578                                scm_to_double,scm_from_double);
    579     specialize_std_pair_on_both(short,scm_is_number,
    580                                scm_to_long,scm_from_long,
    581                                std::string,scm_is_string,
    582                                SWIG_scm2string,SWIG_string2scm);
    583     specialize_std_pair_on_both(long,scm_is_number,
    584                                scm_to_long,scm_from_long,
    585                                bool,scm_is_bool,
    586                                scm_is_true,SWIG_bool2scm);
    587     specialize_std_pair_on_both(long,scm_is_number,
    588                                scm_to_long,scm_from_long,
    589                                int,scm_is_number,
    590                                scm_to_long,scm_from_long);
    591     specialize_std_pair_on_both(long,scm_is_number,
    592                                scm_to_long,scm_from_long,
    593                                short,scm_is_number,
    594                                scm_to_long,scm_from_long);
    595     specialize_std_pair_on_both(long,scm_is_number,
    596                                scm_to_long,scm_from_long,
    597                                long,scm_is_number,
    598                                scm_to_long,scm_from_long);
    599     specialize_std_pair_on_both(long,scm_is_number,
    600                                scm_to_long,scm_from_long,
    601                                unsigned int,scm_is_number,
    602                                scm_to_ulong,scm_from_ulong);
    603     specialize_std_pair_on_both(long,scm_is_number,
    604                                scm_to_long,scm_from_long,
    605                                unsigned short,scm_is_number,
    606                                scm_to_ulong,scm_from_ulong);
    607     specialize_std_pair_on_both(long,scm_is_number,
    608                                scm_to_long,scm_from_long,
    609                                unsigned long,scm_is_number,
    610                                scm_to_ulong,scm_from_ulong);
    611     specialize_std_pair_on_both(long,scm_is_number,
    612                                scm_to_long,scm_from_long,
    613                                double,scm_is_number,
    614                                scm_to_double,scm_from_double);
    615     specialize_std_pair_on_both(long,scm_is_number,
    616                                scm_to_long,scm_from_long,
    617                                float,scm_is_number,
    618                                scm_to_double,scm_from_double);
    619     specialize_std_pair_on_both(long,scm_is_number,
    620                                scm_to_long,scm_from_long,
    621                                std::string,scm_is_string,
    622                                SWIG_scm2string,SWIG_string2scm);
    623     specialize_std_pair_on_both(unsigned int,scm_is_number,
    624                                scm_to_ulong,scm_from_ulong,
    625                                bool,scm_is_bool,
    626                                scm_is_true,SWIG_bool2scm);
    627     specialize_std_pair_on_both(unsigned int,scm_is_number,
    628                                scm_to_ulong,scm_from_ulong,
    629                                int,scm_is_number,
    630                                scm_to_long,scm_from_long);
    631     specialize_std_pair_on_both(unsigned int,scm_is_number,
    632                                scm_to_ulong,scm_from_ulong,
    633                                short,scm_is_number,
    634                                scm_to_long,scm_from_long);
    635     specialize_std_pair_on_both(unsigned int,scm_is_number,
    636                                scm_to_ulong,scm_from_ulong,
    637                                long,scm_is_number,
    638                                scm_to_long,scm_from_long);
    639     specialize_std_pair_on_both(unsigned int,scm_is_number,
    640                                scm_to_ulong,scm_from_ulong,
    641                                unsigned int,scm_is_number,
    642                                scm_to_ulong,scm_from_ulong);
    643     specialize_std_pair_on_both(unsigned int,scm_is_number,
    644                                scm_to_ulong,scm_from_ulong,
    645                                unsigned short,scm_is_number,
    646                                scm_to_ulong,scm_from_ulong);
    647     specialize_std_pair_on_both(unsigned int,scm_is_number,
    648                                scm_to_ulong,scm_from_ulong,
    649                                unsigned long,scm_is_number,
    650                                scm_to_ulong,scm_from_ulong);
    651     specialize_std_pair_on_both(unsigned int,scm_is_number,
    652                                scm_to_ulong,scm_from_ulong,
    653                                double,scm_is_number,
    654                                scm_to_double,scm_from_double);
    655     specialize_std_pair_on_both(unsigned int,scm_is_number,
    656                                scm_to_ulong,scm_from_ulong,
    657                                float,scm_is_number,
    658                                scm_to_double,scm_from_double);
    659     specialize_std_pair_on_both(unsigned int,scm_is_number,
    660                                scm_to_ulong,scm_from_ulong,
    661                                std::string,scm_is_string,
    662                                SWIG_scm2string,SWIG_string2scm);
    663     specialize_std_pair_on_both(unsigned short,scm_is_number,
    664                                scm_to_ulong,scm_from_ulong,
    665                                bool,scm_is_bool,
    666                                scm_is_true,SWIG_bool2scm);
    667     specialize_std_pair_on_both(unsigned short,scm_is_number,
    668                                scm_to_ulong,scm_from_ulong,
    669                                int,scm_is_number,
    670                                scm_to_long,scm_from_long);
    671     specialize_std_pair_on_both(unsigned short,scm_is_number,
    672                                scm_to_ulong,scm_from_ulong,
    673                                short,scm_is_number,
    674                                scm_to_long,scm_from_long);
    675     specialize_std_pair_on_both(unsigned short,scm_is_number,
    676                                scm_to_ulong,scm_from_ulong,
    677                                long,scm_is_number,
    678                                scm_to_long,scm_from_long);
    679     specialize_std_pair_on_both(unsigned short,scm_is_number,
    680                                scm_to_ulong,scm_from_ulong,
    681                                unsigned int,scm_is_number,
    682                                scm_to_ulong,scm_from_ulong);
    683     specialize_std_pair_on_both(unsigned short,scm_is_number,
    684                                scm_to_ulong,scm_from_ulong,
    685                                unsigned short,scm_is_number,
    686                                scm_to_ulong,scm_from_ulong);
    687     specialize_std_pair_on_both(unsigned short,scm_is_number,
    688                                scm_to_ulong,scm_from_ulong,
    689                                unsigned long,scm_is_number,
    690                                scm_to_ulong,scm_from_ulong);
    691     specialize_std_pair_on_both(unsigned short,scm_is_number,
    692                                scm_to_ulong,scm_from_ulong,
    693                                double,scm_is_number,
    694                                scm_to_double,scm_from_double);
    695     specialize_std_pair_on_both(unsigned short,scm_is_number,
    696                                scm_to_ulong,scm_from_ulong,
    697                                float,scm_is_number,
    698                                scm_to_double,scm_from_double);
    699     specialize_std_pair_on_both(unsigned short,scm_is_number,
    700                                scm_to_ulong,scm_from_ulong,
    701                                std::string,scm_is_string,
    702                                SWIG_scm2string,SWIG_string2scm);
    703     specialize_std_pair_on_both(unsigned long,scm_is_number,
    704                                scm_to_ulong,scm_from_ulong,
    705                                bool,scm_is_bool,
    706                                scm_is_true,SWIG_bool2scm);
    707     specialize_std_pair_on_both(unsigned long,scm_is_number,
    708                                scm_to_ulong,scm_from_ulong,
    709                                int,scm_is_number,
    710                                scm_to_long,scm_from_long);
    711     specialize_std_pair_on_both(unsigned long,scm_is_number,
    712                                scm_to_ulong,scm_from_ulong,
    713                                short,scm_is_number,
    714                                scm_to_long,scm_from_long);
    715     specialize_std_pair_on_both(unsigned long,scm_is_number,
    716                                scm_to_ulong,scm_from_ulong,
    717                                long,scm_is_number,
    718                                scm_to_long,scm_from_long);
    719     specialize_std_pair_on_both(unsigned long,scm_is_number,
    720                                scm_to_ulong,scm_from_ulong,
    721                                unsigned int,scm_is_number,
    722                                scm_to_ulong,scm_from_ulong);
    723     specialize_std_pair_on_both(unsigned long,scm_is_number,
    724                                scm_to_ulong,scm_from_ulong,
    725                                unsigned short,scm_is_number,
    726                                scm_to_ulong,scm_from_ulong);
    727     specialize_std_pair_on_both(unsigned long,scm_is_number,
    728                                scm_to_ulong,scm_from_ulong,
    729                                unsigned long,scm_is_number,
    730                                scm_to_ulong,scm_from_ulong);
    731     specialize_std_pair_on_both(unsigned long,scm_is_number,
    732                                scm_to_ulong,scm_from_ulong,
    733                                double,scm_is_number,
    734                                scm_to_double,scm_from_double);
    735     specialize_std_pair_on_both(unsigned long,scm_is_number,
    736                                scm_to_ulong,scm_from_ulong,
    737                                float,scm_is_number,
    738                                scm_to_double,scm_from_double);
    739     specialize_std_pair_on_both(unsigned long,scm_is_number,
    740                                scm_to_ulong,scm_from_ulong,
    741                                std::string,scm_is_string,
    742                                SWIG_scm2string,SWIG_string2scm);
    743     specialize_std_pair_on_both(double,scm_is_number,
    744                                scm_to_double,scm_from_double,
    745                                bool,scm_is_bool,
    746                                scm_is_true,SWIG_bool2scm);
    747     specialize_std_pair_on_both(double,scm_is_number,
    748                                scm_to_double,scm_from_double,
    749                                int,scm_is_number,
    750                                scm_to_long,scm_from_long);
    751     specialize_std_pair_on_both(double,scm_is_number,
    752                                scm_to_double,scm_from_double,
    753                                short,scm_is_number,
    754                                scm_to_long,scm_from_long);
    755     specialize_std_pair_on_both(double,scm_is_number,
    756                                scm_to_double,scm_from_double,
    757                                long,scm_is_number,
    758                                scm_to_long,scm_from_long);
    759     specialize_std_pair_on_both(double,scm_is_number,
    760                                scm_to_double,scm_from_double,
    761                                unsigned int,scm_is_number,
    762                                scm_to_ulong,scm_from_ulong);
    763     specialize_std_pair_on_both(double,scm_is_number,
    764                                scm_to_double,scm_from_double,
    765                                unsigned short,scm_is_number,
    766                                scm_to_ulong,scm_from_ulong);
    767     specialize_std_pair_on_both(double,scm_is_number,
    768                                scm_to_double,scm_from_double,
    769                                unsigned long,scm_is_number,
    770                                scm_to_ulong,scm_from_ulong);
    771     specialize_std_pair_on_both(double,scm_is_number,
    772                                scm_to_double,scm_from_double,
    773                                double,scm_is_number,
    774                                scm_to_double,scm_from_double);
    775     specialize_std_pair_on_both(double,scm_is_number,
    776                                scm_to_double,scm_from_double,
    777                                float,scm_is_number,
    778                                scm_to_double,scm_from_double);
    779     specialize_std_pair_on_both(double,scm_is_number,
    780                                scm_to_double,scm_from_double,
    781                                std::string,scm_is_string,
    782                                SWIG_scm2string,SWIG_string2scm);
    783     specialize_std_pair_on_both(float,scm_is_number,
    784                                scm_to_double,scm_from_double,
    785                                bool,scm_is_bool,
    786                                scm_is_true,SWIG_bool2scm);
    787     specialize_std_pair_on_both(float,scm_is_number,
    788                                scm_to_double,scm_from_double,
    789                                int,scm_is_number,
    790                                scm_to_long,scm_from_long);
    791     specialize_std_pair_on_both(float,scm_is_number,
    792                                scm_to_double,scm_from_double,
    793                                short,scm_is_number,
    794                                scm_to_long,scm_from_long);
    795     specialize_std_pair_on_both(float,scm_is_number,
    796                                scm_to_double,scm_from_double,
    797                                long,scm_is_number,
    798                                scm_to_long,scm_from_long);
    799     specialize_std_pair_on_both(float,scm_is_number,
    800                                scm_to_double,scm_from_double,
    801                                unsigned int,scm_is_number,
    802                                scm_to_ulong,scm_from_ulong);
    803     specialize_std_pair_on_both(float,scm_is_number,
    804                                scm_to_double,scm_from_double,
    805                                unsigned short,scm_is_number,
    806                                scm_to_ulong,scm_from_ulong);
    807     specialize_std_pair_on_both(float,scm_is_number,
    808                                scm_to_double,scm_from_double,
    809                                unsigned long,scm_is_number,
    810                                scm_to_ulong,scm_from_ulong);
    811     specialize_std_pair_on_both(float,scm_is_number,
    812                                scm_to_double,scm_from_double,
    813                                double,scm_is_number,
    814                                scm_to_double,scm_from_double);
    815     specialize_std_pair_on_both(float,scm_is_number,
    816                                scm_to_double,scm_from_double,
    817                                float,scm_is_number,
    818                                scm_to_double,scm_from_double);
    819     specialize_std_pair_on_both(float,scm_is_number,
    820                                scm_to_double,scm_from_double,
    821                                std::string,scm_is_string,
    822                                SWIG_scm2string,SWIG_string2scm);
    823     specialize_std_pair_on_both(std::string,scm_is_string,
    824                                SWIG_scm2string,SWIG_string2scm,
    825                                bool,scm_is_bool,
    826                                scm_is_true,SWIG_bool2scm);
    827     specialize_std_pair_on_both(std::string,scm_is_string,
    828                                SWIG_scm2string,SWIG_string2scm,
    829                                int,scm_is_number,
    830                                scm_to_long,scm_from_long);
    831     specialize_std_pair_on_both(std::string,scm_is_string,
    832                                SWIG_scm2string,SWIG_string2scm,
    833                                short,scm_is_number,
    834                                scm_to_long,scm_from_long);
    835     specialize_std_pair_on_both(std::string,scm_is_string,
    836                                SWIG_scm2string,SWIG_string2scm,
    837                                long,scm_is_number,
    838                                scm_to_long,scm_from_long);
    839     specialize_std_pair_on_both(std::string,scm_is_string,
    840                                SWIG_scm2string,SWIG_string2scm,
    841                                unsigned int,scm_is_number,
    842                                scm_to_ulong,scm_from_ulong);
    843     specialize_std_pair_on_both(std::string,scm_is_string,
    844                                SWIG_scm2string,SWIG_string2scm,
    845                                unsigned short,scm_is_number,
    846                                scm_to_ulong,scm_from_ulong);
    847     specialize_std_pair_on_both(std::string,scm_is_string,
    848                                SWIG_scm2string,SWIG_string2scm,
    849                                unsigned long,scm_is_number,
    850                                scm_to_ulong,scm_from_ulong);
    851     specialize_std_pair_on_both(std::string,scm_is_string,
    852                                SWIG_scm2string,SWIG_string2scm,
    853                                double,scm_is_number,
    854                                scm_to_double,scm_from_double);
    855     specialize_std_pair_on_both(std::string,scm_is_string,
    856                                SWIG_scm2string,SWIG_string2scm,
    857                                float,scm_is_number,
    858                                scm_to_double,scm_from_double);
    859     specialize_std_pair_on_both(std::string,scm_is_string,
    860                                SWIG_scm2string,SWIG_string2scm,
    861                                std::string,scm_is_string,
    862                                SWIG_scm2string,SWIG_string2scm);
    863 }
    864