Index: Singular/feread.cc
===================================================================
--- Singular/feread.cc	(revision 68297e89c8c24c38656fd40ec740a03c2fdff568)
+++ Singular/feread.cc	(revision cf74099cd4e3289c268dfffa7cac3bb755132714)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: feread.cc,v 1.29 1999-11-15 14:37:01 Singular Exp $ */
+/* $Id: feread.cc,v 1.30 1999-11-17 18:22:52 Singular Exp $ */
 /*
 * ABSTRACT: input from ttys, simulating fgets
@@ -361,5 +361,8 @@
   if (res!=0)
   {
-    Warn("dynamic loading failed: %d\n",res);
+    if (res==1)
+      WarnS("dynamic loading of libreadline failed");
+    else
+      Warn("dynamic loading failed: %d\n",res);
     fe_fgets_stdin=fe_fgets_stdin_emu;
     return fe_fgets_stdin_emu(pr,s,size);
Index: Singular/grammar.y
===================================================================
--- Singular/grammar.y	(revision 68297e89c8c24c38656fd40ec740a03c2fdff568)
+++ Singular/grammar.y	(revision cf74099cd4e3289c268dfffa7cac3bb755132714)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: grammar.y,v 1.74 1999-11-15 17:20:04 obachman Exp $ */
+/* $Id: grammar.y,v 1.75 1999-11-17 18:22:53 Singular Exp $ */
 /*
 * ABSTRACT: SINGULAR shell grammatik
@@ -326,5 +326,5 @@
             #endif
             prompt_char = '>';
-	    if (sdb_flags & 2) { sdb_flags=1; YYERROR; }
+            if (sdb_flags & 2) { sdb_flags=1; YYERROR; }
             if(siCntrlc)
             {
@@ -365,5 +365,5 @@
             siq=0;
             #endif
-	    yyInRingConstruction = FALSE;
+            yyInRingConstruction = FALSE;
             currentVoice->ifsw=0;
             if (inerror)
@@ -381,9 +381,9 @@
             yyerror("");
             yyerrok;
-	    if ((sdb_flags & 1) && currentVoice->pi!=NULL)
-	    {
-	      currentVoice->pi->trace_flag |=1;
-	    } 
-	    else
+            if ((sdb_flags & 1) && currentVoice->pi!=NULL)
+            {
+              currentVoice->pi->trace_flag |=1;
+            }
+            else
             if (myynest>0)
             {
@@ -400,5 +400,5 @@
               exitVoice();
             }
-	    if (sdb_flags &2) sdb_flags=1;
+            if (sdb_flags &2) sdb_flags=1;
           }
         ;
@@ -478,5 +478,5 @@
               memset(&tmp,0,sizeof(tmp));
               i=iiTestConvert((t=v->Typ()),POLY_CMD);
-              if((i==0) || (iiConvert(t /*v->Typ()*/,POLY_CMD,i,v,&tmp))) 
+              if((i==0) || (iiConvert(t /*v->Typ()*/,POLY_CMD,i,v,&tmp)))
               {
                 pDelete((poly *)&$$.data);
@@ -664,4 +664,12 @@
             if(iiExprArith1(&$$,&$3,INTMAT_CMD)) YYERROR;
           }
+        | RING_CMD '(' rlist ',' rlist ',' ordering ')'
+          {
+            if(iiExprArith3(&$$,RING_CMD,&$3,&$5,&$7)) YYERROR;
+          }
+        | RING_CMD '(' expr ')'
+          {
+            if(iiExprArith1(&$$,&$3,RING_CMD)) YYERROR;
+          }
         | quote_start expr quote_end
           {
@@ -950,5 +958,5 @@
         UNKNOWN_IDENT
         {
-          // let rInit take care of any errors 
+          // let rInit take care of any errors
           $$=rOrderName($1);
         }
@@ -1129,14 +1137,14 @@
             else
             {
-#ifdef HAVE_NAMESPACES
-            if (v->packhdl != NULL)
-            {
-              namespaceroot->push( IDPACKAGE(v->packhdl) , IDID(v->packhdl));
-              killhdl((idhdl)v->data);
-              namespaceroot->pop();
-            }
-            else 
-#endif /* HAVE_NAMESPACES */
-              killhdl((idhdl)v->data);
+            #ifdef HAVE_NAMESPACES
+              if (v->packhdl != NULL)
+              {
+                namespaceroot->push( IDPACKAGE(v->packhdl) , IDID(v->packhdl));
+                killhdl((idhdl)v->data);
+                namespaceroot->pop();
+              }
+              else
+              #endif /* HAVE_NAMESPACES */
+                killhdl((idhdl)v->data);
             }
             v=v->next;
@@ -1332,14 +1340,27 @@
               }
             #endif /* HAVE_NAMESPACES */
-            idhdl b=
-            rInit(ring_name,      /* ringname */
-                  &$4,            /* characteristik and list of parameters*/
+            ring b=
+            rInit(&$4,            /* characteristik and list of parameters*/
                   &$6,            /* names of ringvariables */
                   &$8);            /* ordering */
-#ifdef HAVE_NAMESPACES
-            if(do_pop) namespaceroot->pop();
-#endif /* HAVE_NAMESPACES */
-	    yyInRingConstruction = FALSE;
-            if (b==NULL)
+            idhdl newRingHdl=NULL;
+            if (b!=NULL)
+            {
+              newRingHdl=enterid(ring_name, myynest, RING_CMD, &IDROOT);
+              if (newRingHdl!=NULL)
+              {
+                Free(IDRING(newRingHdl),sizeof(ip_sring));
+                IDRING(newRingHdl)=b;
+              }
+              else
+              {
+                rKill(b);
+              }
+            }
+            #ifdef HAVE_NAMESPACES
+              if(do_pop) namespaceroot->pop();
+            #endif /* HAVE_NAMESPACES */
+            yyInRingConstruction = FALSE;
+            if (newRingHdl==NULL)
             {
               MYYERROR("cannot make ring");
@@ -1347,5 +1368,5 @@
             else
             {
-              rSetHdl(b);
+              rSetHdl(newRingHdl);
             }
           }
@@ -1354,57 +1375,19 @@
             BOOLEAN do_pop = FALSE;
             char *ring_name = $2.name;
-#ifdef HAVE_NAMESPACES
-            if (((sleftv)$2).req_packhdl != NULL)
-            {
-              namespaceroot->push( IDPACKAGE(((sleftv)$2).req_packhdl) , "");
-              do_pop = TRUE;
-              if( (((sleftv)$2).req_packhdl != NULL) &&
+            #ifdef HAVE_NAMESPACES
+              if (((sleftv)$2).req_packhdl != NULL)
+              {
+                namespaceroot->push( IDPACKAGE(((sleftv)$2).req_packhdl) , "");
+                do_pop = TRUE;
+                if( (((sleftv)$2).req_packhdl != NULL) &&
                   (((sleftv)$2).packhdl != ((sleftv)$2).req_packhdl))
-                ring_name = mstrdup($2.name);
-            }
-#endif /* HAVE_NAMESPACES */
+                  ring_name = mstrdup($2.name);
+              }
+            #endif /* HAVE_NAMESPACES */
             if (!inerror) rDefault(ring_name);
-#ifdef HAVE_NAMESPACES
-            if(do_pop) namespaceroot->pop();
-#endif /* HAVE_NAMESPACES */
-	    yyInRingConstruction = FALSE;
-          }
-        | DRING_CMD { yyInRingConstruction = TRUE; }
-          elemexpr cmdeq
-          rlist     ','       /* description of coeffs */
-          rlist     ','       /* var names */
-          ordering           /* list of (multiplier ordering (weight(s))) */
-          {
-            #ifdef DRING
-            BOOLEAN do_pop = FALSE;
-            idhdl h;
-            char *ring_name = $3.name;
-#ifdef HAVE_NAMESPACES
-            if (((sleftv)$3).req_packhdl != NULL)
-            {
-              namespaceroot->push( IDPACKAGE(((sleftv)$3).req_packhdl) , "");
-              do_pop = TRUE;
-              if( (((sleftv)$2).req_packhdl != NULL) &&
-                  (((sleftv)$3).packhdl != ((sleftv)$3).req_packhdl))
-                ring_name = mstrdup($3.name);
-            }
-#endif /* HAVE_NAMESPACES */
-            h=rInit($3.name,    /* ringname */
-                   &$5,         /* characteristik and list of parameters*/
-                   &$7,         /* names of ringvariables */
-                   &$9,         /* ordering */
-                   TRUE);       /* is a dring */
-#ifdef HAVE_NAMESPACES
-            if(do_pop) namespaceroot->pop();
-#endif /* HAVE_NAMESPACES */
-            if(h==NULL)
-            {
-              YYERROR;
-            }
-            rSetHdl(h);
-            setFlag(h,FLAG_DRING);
-            rDSet();
-            #endif
-	    yyInRingConstruction = FALSE;
+            #ifdef HAVE_NAMESPACES
+              if(do_pop) namespaceroot->pop();
+            #endif /* HAVE_NAMESPACES */
+            yyInRingConstruction = FALSE;
           }
         ;
Index: Singular/iparith.cc
===================================================================
--- Singular/iparith.cc	(revision 68297e89c8c24c38656fd40ec740a03c2fdff568)
+++ Singular/iparith.cc	(revision cf74099cd4e3289c268dfffa7cac3bb755132714)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: iparith.cc,v 1.186 1999-11-15 17:20:08 obachman Exp $ */
+/* $Id: iparith.cc,v 1.187 1999-11-17 18:22:54 Singular Exp $ */
 
 /*
@@ -4238,4 +4238,9 @@
 }
 #endif
+static BOOLEAN jjRING3(leftv res, leftv u, leftv v, leftv w)
+{
+  res->data=(void *)rInit(u,v,w);
+  return (res->data==NULL);
+}
 static BOOLEAN jjSTATUS3(leftv res, leftv u, leftv v, leftv w)
 {
@@ -4334,4 +4339,5 @@
 ,{jjWRONG3,         RESULTANT_CMD, POLY_CMD,POLY_CMD,   POLY_CMD,   POLY_CMD }
 #endif
+,{jjRING3,          RING_CMD,   RING_CMD,   DEF_CMD,    DEF_CMD,    DEF_CMD }
 #ifdef HAVE_SPECTRUM
 ,{semicProc3,       SEMIC_CMD,  INT_CMD,    LIST_CMD,   LIST_CMD,   INT_CMD }
Index: Singular/ring.cc
===================================================================
--- Singular/ring.cc	(revision 68297e89c8c24c38656fd40ec740a03c2fdff568)
+++ Singular/ring.cc	(revision cf74099cd4e3289c268dfffa7cac3bb755132714)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: ring.cc,v 1.83 1999-11-17 10:51:02 obachman Exp $ */
+/* $Id: ring.cc,v 1.84 1999-11-17 18:22:55 Singular Exp $ */
 
 /*
@@ -483,5 +483,6 @@
 // NOTE:   * makes new ring to current ring, on success
 //         * considers input sleftv's as read-only
-idhdl rInit(char *s, sleftv* pn, sleftv* rv, sleftv* ord)
+//idhdl rInit(char *s, sleftv* pn, sleftv* rv, sleftv* ord)
+ring rInit(sleftv* pn, sleftv* rv, sleftv* ord)
 {
   int ch;
@@ -637,5 +638,5 @@
   rTest(R);
 
-  // try to enter the ring into the name list //
+  // try to enter the ring into the name list
   // need to clean up sleftv here, before this ring can be set to
   // new currRing or currRing can be killed beacuse new ring has
@@ -644,11 +645,12 @@
   if (rv != NULL) rv->CleanUp();
   if (ord != NULL) ord->CleanUp();
-  if ((tmp = enterid(s, myynest, RING_CMD, &IDROOT))==NULL)
-    goto rInitError;
-
-  memcpy(IDRING(tmp),R,sizeof(*R));
+  //if ((tmp = enterid(s, myynest, RING_CMD, &IDROOT))==NULL)
+  //  goto rInitError;
+
+  //memcpy(IDRING(tmp),R,sizeof(*R));
   // set current ring
-  FreeSizeOf(R,  ip_sring);
-  return tmp;
+  //FreeSizeOf(R,  ip_sring);
+  //return tmp;
+  return R;
 
   // error case:
@@ -1732,5 +1734,5 @@
  * DOES NOT CALL rComplete
  */
-static ring rCopy0(ring r, BOOLEAN copy_qideal = TRUE, 
+static ring rCopy0(ring r, BOOLEAN copy_qideal = TRUE,
                    BOOLEAN copy_ordering = TRUE)
 {
@@ -1788,5 +1790,5 @@
   }
   res->idroot = NULL;
-  if (r->qideal!=NULL) 
+  if (r->qideal!=NULL)
   {
     if (copy_qideal) res->qideal= idCopy(r->qideal);
@@ -3071,12 +3073,12 @@
   if (r->order[0] == ringorder_s)
   {
-    if (r->pCompIndex == r->ExpESize-3) 
+    if (r->pCompIndex == r->ExpESize-3)
       r->pOrdIndex = r->ExpLSize-3;
     else
       r->pOrdIndex = r->ExpLSize-2;
   }
-  else if (r->pCompIndex == r->ExpESize-1) 
+  else if (r->pCompIndex == r->ExpESize-1)
     r->pOrdIndex=r->ExpLSize-2;
-  else                               
+  else
     r->pOrdIndex=r->ExpLSize-1;
 #endif
@@ -3095,5 +3097,5 @@
     if (r->order[0] == ringorder_s && r->typ[0].data.syz.limit > 0)
     {
-      Free(r->typ[0].data.syz.syz_index, 
+      Free(r->typ[0].data.syz.syz_index,
            (r->typ[0].data.syz.limit +1)*sizeof(int));
     }
@@ -3280,5 +3282,5 @@
 // where R has a certain property. P might be equal r in which case r
 // had already this property
-// 
+//
 // Without argument, these functions work on currRing and change it,
 // if necessary
@@ -3289,9 +3291,9 @@
 {
   ring r = rAssureSyzComp(currRing);
-  if (r != currRing) 
+  if (r != currRing)
   {
     ring old_ring = currRing;
     rChangeCurrRing(r, TRUE);
-    if (old_ring->qideal != NULL) 
+    if (old_ring->qideal != NULL)
     {
       r->qideal = idrCopyR_NoSort(old_ring->qideal, old_ring);
@@ -3322,5 +3324,5 @@
 
   int ** wvhdl =(int **)Alloc0((i+1)*sizeof(int**));
-  for(j=i;j>0;j--) 
+  for(j=i;j>0;j--)
   {
     if (r->wvhdl[j-1] != NULL)
@@ -3335,5 +3337,5 @@
   return res;
 }
-  
+
 
 // use this for global orderings consisting of two blocks
@@ -3342,12 +3344,12 @@
   int r_blocks = rBlocks(currRing);
   int i;
-  
-  assume(b1 == ringorder_c || b1 == ringorder_C || 
-         b2 == ringorder_c || b1 == ringorder_C || 
+
+  assume(b1 == ringorder_c || b1 == ringorder_C ||
+         b2 == ringorder_c || b1 == ringorder_C ||
          b2 == ringorder_S);
-  
+
   if (r_blocks == 2 && currRing->order[0] == b1 && currRing->order[2] == 0)
     return currRing;
-  
+
   ring res = rCopy0(currRing, FALSE, FALSE);
   res->order = (int*)Alloc0(3*sizeof(int));
@@ -3407,5 +3409,5 @@
     {
       currRing->typ[0].data.syz.syz_index = (int*)
-        ReAlloc(currRing->typ[0].data.syz.syz_index, 
+        ReAlloc(currRing->typ[0].data.syz.syz_index,
                 (currRing->typ[0].data.syz.limit+1)*sizeof(int),
                 (k+1)*sizeof(int));
@@ -3413,5 +3415,5 @@
     for (i=currRing->typ[0].data.syz.limit + 1; i<= k; i++)
     {
-      currRing->typ[0].data.syz.syz_index[i] = 
+      currRing->typ[0].data.syz.syz_index[i] =
         currRing->typ[0].data.syz.curr_index;
     }
@@ -3449,4 +3451,2 @@
   }
 }
-
-    
Index: Singular/ring.h
===================================================================
--- Singular/ring.h	(revision 68297e89c8c24c38656fd40ec740a03c2fdff568)
+++ Singular/ring.h	(revision cf74099cd4e3289c268dfffa7cac3bb755132714)
@@ -7,5 +7,5 @@
 * ABSTRACT - the interpreter related ring operations
 */
-/* $Id: ring.h,v 1.41 1999-11-17 10:51:04 obachman Exp $ */
+/* $Id: ring.h,v 1.42 1999-11-17 18:22:56 Singular Exp $ */
 
 /* includes */
@@ -18,5 +18,5 @@
 void   rChangeCurrRing(ring r, BOOLEAN complete = TRUE);
 void   rSetHdl(idhdl h, BOOLEAN complete = TRUE);
-idhdl  rInit(char *s, sleftv* pn, sleftv* rv, sleftv* ord);
+ring   rInit(sleftv* pn, sleftv* rv, sleftv* ord);
 idhdl  rDefault(char *s);
 int    rIsRingVar(char *n);
@@ -143,5 +143,5 @@
 }
 
-typedef enum rRingOrder_t 
+typedef enum rRingOrder_t
 {
   ringorder_no = 0,
@@ -187,5 +187,5 @@
 
 inline int rGetCurrSyzLimit()
-{ return (currRing->order[0] == ringorder_s ? 
+{ return (currRing->order[0] == ringorder_s ?
           currRing->typ[0].data.syz.limit : 0);}
 
@@ -199,5 +199,5 @@
 // Assume: i<= syzIndex_limit
 int rGetMaxSyzComp(int i);
-  
+
 BOOLEAN rHasSimpleOrder(ring r);
 // returns TRUE, if simple lp or ls ordering
