• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • FMSLogo
  • Bugs
FMSLogo

Procedure that redefines itself to take more inputs can't call itself afterward

A Logo programming environment for Microsoft Windows

Brought to you by: david_costanzo
  • Summary
  • Files
  • Reviews
  • Support
  • Tickets ▾
    • Feature Requests
    • Bugs
    • Support Requests
  • Discussion
  • Code
Menu ▾ ▴
  • Create Ticket
  • View Stats

Group

  • v_6.06x
  • v_6.07.X
  • v_6.08.X
  • v_6.10.X
  • v_6.11.X
  • v_6.13.X
  • v_6.22.X
  • v_6.25.X
  • v_6.26.X
  • v_6.27.X
  • v_6.28.X
  • v_6.29.X

Searches

  • Changes
  • Closed Tickets
  • Open Tickets

Help

  • Formatting Help

#609 Procedure that redefines itself to take more inputs can't call itself afterward

v_6.06x
closed-fixed
nobody
None
5
2026-07-06
2026-04-29
David Costanzo
No

A procedure that redefines itself to take more inputs than it took originally can't subsequently call itself recursively. The problem seems to be that the previous definition cached how many inputs it was supposed to take and the cache isn't invalidated. More technically, the procedure was "treeified" with the original number of arguments and it's retreeified when the definition changes.

A procedure can redefine itself and then subsequently call itself. The problem is specific to when the number of inputs change.

Steps to Reproduce:
Step 1: Define the procedure that redefines itself:

DEFINE "REDEFINEWHILERUNNING [ []
    ; Redefine the procedure take an input.
    [ DEFINE "REDEFINEWHILERUNNING [ [arg] [OUTPUT :arg] ] ]

    ; Run the new definition to output 1.
    [ OUTPUT REDEFINEWHILERUNNING 1 ]
]

Step 2: Run the procedure with the original definition

SHOW REDEFINEWHILERUNNING

Step 3: Run the procedure with the new definition

SHOW REDEFINEWHILERUNNING 2

What Happens:
Step 2 throws an error because the final line of the original definition still expects the procedure to take no inputs.

not enough inputs to REDEFINEWHILERUNNING in REDEFINEWHILERUNNING
[OUTPUT REDEFINEWHILERUNNING 1]

Expected Result:
Step 2 prints 1.
Step 3 prints 2.

Discussion

  • David Costanzo

    David Costanzo - 2026-04-30
     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • David Costanzo

    David Costanzo - 2026-04-30

    MSWLogo 6.5b has similar behavior, except that for Step 2 the error looks like:

    SHOW REDEFINEWHILERUNNING
    arg has no value  in REDEFINEWHILERUNNING
    [OUTPUT :arg]
    

    Therefore, this is not a regression.

    UCBLogo 6.2 behaves correctly (as described in "Expected Result").

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • David Costanzo

    David Costanzo - 2026-07-06
    • status: open --> closed-fixed
     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • David Costanzo

    David Costanzo - 2026-07-06

    This was fixed by [r6343]. The fix will be available in FMSLogo 8.6.0.

    This bug had four variants. It affected running procedures that are:

    1. redefined with DEFINE
    2. redefined with TO
    3. erased with ERASE
    4. overwritten with COPYDEF

    The problem is that these workspace procedures all untreeified the previous procedure.
    This was historically needed because the tree had a circular reference and changing
    the case object's procnode while it still had a tree would leak the tree. However,
    the evaluator can't handle when a running procedure is untreeified and the generation
    changes, as this sets the tree of bodylist to NIL, and the evaluator can't re-treeify NIL.

    A recent change reworked the structure of a tree to no longer creates circular references.
    Therefore, explicit untreeifying is no longer needed, so that logic could all be removed.

    This is a rare fix where the fix is entirely done by removing code.

     

    Related

    Commit: [r6343]

    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Log in to post a comment.

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    1320 Columbia Street Suite 310
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2026 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise

Cerberus Logo