FANDOM


Syntax

COPYDEF name name

Explanation

COPYDEF copies the definition of its second input to its first input. The second input to COPYDEF must be a name of either a procedure or a primitive.

If you use COPYDEF to redefine a primitive with a new meaning, you will lose the old primitive. For example: COPYDEF "BK "FD redefines BK to move the turtle forward. You must restart Logo to regain the original definition of BK.

Examples

? TO MYNAME

> PRINT [ORLANDO]

> END

MYNAME defined.

? COPYDEF "YRNAME "MYNAME

? PO MYNAME YRNAME

TO MYNAME

PRINT [ORLANDO]

END

TO YRNAME

PRINT [ORLANDO]

END

? MYNAME

ORLANDO

? YRNAME

ORLANDO

?