(yacc/Doc/intro.jp.txt, 1997, 4/9)

Q. ޤ, k0 äƤɤʸǤ?

A. C  Java  class Ȥꤤ줿󥿥ץ꥿Ǥ.  

   ȤƻѤˤ, k0 ư, Ȥ
    
    2^10+1 :

   Ϥ 210­1η̤ɽƤޤ. 

   ѿȤ,
   a =     2^10+1 ;
   a^3 :

   Ϥ  (2^10+1)^3 ׻Ǥޤ.

   : 򤪤ɾ̤ɽޤ.
   ; ɾ򤪤ʤ, ̤ɽϤޤ.
   k0 ʸȾʸζ̤򤪤ʤޤΤդƲ.

  
   Ǥ, ĥץ򤪸ޤ礦.
   , 1!, 2!, ..., n! ɽץǤ.
   afo(20); Ϥ 20 ޤǤγɽϤޤ.

   def afo(n) {
      local tmp,i;
      tmp = 1;
      for (i=1; i<=n ; i++) {
         tmp = tmp*i;
         Println(tmp);
      }
      return(tmp);
   }
   afo(20);

   ٤ΥץηиͤϾߤФȤ
   ʬǤ礦.
   饹ѤˤĤƤ, kxx97/yacc/debug/trip3.k 򸫤Ʋ.      
   
   help(); ϤѤǤؿΰɽޤ.

   quit(); ϤȽλޤ.

Q. ʸˡäդ.

A. break , while Τߤ˻Ȥޤ.

Q. k0 Υ顼åϤɤΤ褦ˤߤޤ?

A. 
ޤ礦.

   [1,2]+1 :

   Ϥ, Τ褦ʥ顼Ǥޤ.
WARNING(kanExport[0|1].c): KooAdd() has not supported yet these objects.
ERROR(kanExport[0|1].c):  
--- Engine error or interrupt : The error occured on the top level.
Type in Cleards() to exit the debug mode and Where() to see the stack trace.

ҤȤĤŤỊ̇򸫤ޤ礦.
>WARNING(kanExport[0|1].c): KooAdd() has not supported yet these objects.
KooAdd() , PrimitiveObject ­(add)ؿǤ.  Ǥ,
array  [1,2] , integer  1 ϤʤȤäƤޤ.

>--- Engine error or interrupt : The error occured on the top level.
顼, top level ȤȤƤޤ.

   ⤦ҤȤ򤢤ޤ礦.

   def foo(n) {
     local a;
     a = n^2;
     return(a);
   }

   foo("abc");
ϤȼΤ褦ʥ顼Ǥޤ.

WARNING(kanExport[0|1].c): KooMult() has not supported yet these objects.
ERROR(kanExport[0|1].c):  
--- Engine error or interrupt : In function : foo of class PrimitiveObject
Type in Cleards() to exit the debug mode and Where() to see the stack trace.

ʸΤ "abc"^2 ¹Ԥ褦Ȥ, Υ顼Ǥޤ.
>--- Engine error or interrupt : In function : foo of class PrimitiveObject
, 顼, ؿ foo ǤȤ򤷤ᤷƤޤ.
>of class PrimitiveObject
, class Ѥƴؿ overload 򤹤褦ˤʤỌ̇̄ޤ.
class Ѥʤ, Ĥͤ of class PrimitiveObject Ǥ.

>Type in Cleards() to exit the debug mode and Where() to see the stack trace.
Ϥɤạ̈Ǥ礦.
ץब顼Ǥǳѿ, ǤͤϤäƤޤ.
Ȥ,
    n:
Ϥ,
abc
ʤͤäƤޤ.
      Cleards();
Ϥѿ, ؿ̤ǤȤξ֤ˤɤޤ.
Clearing DebugStack and ErrorStack... 
Restoring variables....Done
In[12]=n :
%[null]

%[null] , null ΤȤǤ.

Q. Syntax Error ˤƤϤɤн褷ޤ?

A.
  Syntax error ΤȤ,  ;  Ϥ,  Prompt
  In[i]=  
  Ǥޤ.
  Ȥ,
  foo(10;
  Ϥ,

  Syntax Error in the line 0:parse error
  The error occured when the system is reading the line: foo(10;

  ȽϤޤ.
  The error occured when the system is reading the line: foo(10;
  ΰ̣, foo(10 μ ; ɤ߹, 顼ȤʤäȤ
  ̣Ƥޤ.

  ; Ϥ,
  In[6]=
  Ȥʤޤ.

Q. (иԤμ) k0 ˤϤɤʥǡޤ?

A. PrimitiveObject Ȥ,
   null (̥)
   string (ʸ)
   integer (̵¿Ĺ)
   array (󷿤ޤϥꥹȷ)
   polynomial (¿༰)
   rational (ͭ, integer  polynomial )
   class (饹, Ū PrimitiveObject γĥ˻Ȥޤ.)
   Object (Object , Object , ٤ƤΥ饹Υ롼ȤǤ.
           Object , array ȺǽǤΥǹޤ.)

  k0 , backend 󥸥Ȥ, kan/sm1 ѤƤޤ.
  sm1 , kan96xx/ ʲ directory ˤޤ.
  PrimitiveObject  sm1 ΥǡбϰʲΤȤǤ.

  k0           Ƚؿ             sm1
  ---------------------------------------------------------
  string      IsString(x)          string (Sdollar)
  integer     IsInteger(x)         universalNumber (SuniversalNumber)
  polynomial  IsPolynomial(x)      poly (Spoly)
  rational    IsRational(x)        rational (Srational)
  array       IsArray(x)           array (Sarray)
  Object      x.IsObject()         [class.context, .... ]


Q. (иԤμ) ߤ context ߤˤ?     

A. 
    sm1(" [(CurrentContextp)] system_variable :: ");
  ϤƲ.


Q. (иԤμ) ߤ context ѹˤ?
   ߤ context ̾ɽˤ?

A. ޤ礦.

   load("debug/trip3.k");  /* Complex ޤ. */
   sm1(Complex," 0 get setcontext ");  /* ߤ context  Complex ˤޤ.*/
   sm1(" show_user_dictionary "); ϤȰʲΥǡɽޤ.

   DictionaryName=Complex, super= Object
   new0   show   

   new0  show ƤΤ狼ޤ.

  ɸμ᤹ˤ,
  sm1(PrimitiveObject," 0 get setcontext ");
  ϤƲ.

Q. ʸΤʤ % $  ( ) Ȥޤ.

A. kan/k0 Ϥ sm1 ѴƤ¹Ԥ뤿,
   sm1 ͽ󥷥ܥǤ εʸѤǤޤ.
   εɽˤ, AsciiToString, AddString ȡ
   Ѥɽޤ.
  
   :
   Println(AddString(["You cannot use ",AsciiToString(37),
           " in kan/k0 string"]));
   ¹Ԥ,
   You cannot use % in kan/k0 string
   ɽޤ.