Changeset 6cefd4e in git


Ignore:
Timestamp:
Sep 14, 2005, 6:34:52 PM (19 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
a372281e1116c4ec7fe80194d365fade7ed3a455
Parents:
253eb7fd1cc7dfdb930184ad49447a6aa5500252
Message:
*bricken: further work on lists


git-svn-id: file:///usr/local/Singular/svn/trunk@8622 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
modules/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/python/interpreter.py

    r253eb7 r6cefd4e  
    5757
    5858def mycbm(name,*args):
    59     l=i_arg_list()
    60     for a in args:
    61         if isinstance(a,list):
    62             at=i_arg_list()
    63             for a2 in a:
    64                 at.append(a2)
    65             l.append(at)
    66         else:
    67             l.append(a)
     59    l=list2arg_list(args)
    6860    return cbm(name,l)
  • modules/python/interpreter_support.cc

    r253eb7 r6cefd4e  
    177177   
    178178  }
    179   void appendPrelist(arg_list& l){
    180     int n=l.length();
    181     leftv v=initArg();
     179  lists dumpToLists(){
     180    int n=length();
     181   
    182182    lists res=(lists)omAlloc0Bin(slists_bin);
    183183    res->Init(n);
    184184    for(int i=0;i<n;i++){
    185         leftv iv=l.pop_front();
     185        leftv iv=pop_front();
    186186        //swap the content
    187187        memcpy(&res->m[i],iv,sizeof(sleftv));
     
    189189        omFreeBin(iv, sleftv_bin);
    190190    }
    191     v->data=res;
     191    return res;
     192   
     193  }
     194  void appendPrelist(arg_list& l){
     195    leftv v=initArg();
     196    v->data=l.dumpToLists();
     197
    192198    v->rtyp=LIST_CMD;
    193199    internal_append(v);
Note: See TracChangeset for help on using the changeset viewer.