• 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

Killing a primitive

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

#569 Killing a primitive

v_6.06x
pending
nobody
None
5
2022-01-31
2021-04-12
Manfred Zindel
No

Look at the following action:
I open FMSLogo and type in the following procedure from the command line and its editor:

to circle :radius
        show (word "|You will never get a circle with radius | :radius)
end

After entering this I receive

circle defined

Now I want to draw a circle and write

circle 50

When I press "EXECUTE" the result is

You will never get a circle with radius 50

This should never had happened. Instead when trying to enter my procedure circle, I should have received

circle is already defined

because from the manual I knew that circle is a primitive and a reserved procedure name.

But circle comes from logolib and is not known before it is used for the first time.
Hence I can write my own circle-procedure and use it to kill the primitive circle.

The name circle should be a reserved name, always.

1 Attachments
erase-circle.png

Discussion

  • David Costanzo

    David Costanzo - 2021-04-17
    • status: open --> pending
    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -0,0 +1 @@
    +erase-circle.png (11.4 kB; image/png)
    
     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • David Costanzo

    David Costanzo - 2021-04-17

    This is by design and is useful. For example SLOWDRAW works by replacing the definition of FORWARD. In another ticket, you had replaced EDALL with an improved procedure picker. Being able to redefine CIRCLE has nothing to do with whether you've run CIRCLE or not. You can redefine it at any time.

    The word "primitive" has a specific meaning in FMSLogo. It does not mean "comes with FMSLogo" as you are using it. It means "written in C" (compiled into fmslogo.exe). Even primitives can also be re-defined but you have to set REDEFP to TRUE before doing so.

    CIRCLE is a library function and so is not a primitive:

    :::text
    show primitive? "circle
    false
    

    If you don't want to change the definition of CIRCLE, don't do it. I don't see why you fault FMSLogo for doing what you told it to do. Because CIRCLE is a library procedure, if you want to restore the original definition, you can run ERASE "CIRCLE to erase your bad definition. The next time CIRCLE is run, FMSLogo will load it from the logolib directory (see the attached screenshot).

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

    DanielAjoy - 2022-01-27

    I wonder if there is a way to know whether FMSLogo will be able to load a definition from the library or not.

    Or even a way to preemptively load library definitions so that when a student tries to create a new procedure FMSLogo responds with:

    circle is already defined

    The name circle should be a reserved name, always.

    I've read that some Logos specifically do not offer a circle primitive or library command because they want to give students the chance to come up with a definition for themselves.

    Papert, in one of his books, talks about an instance where a student needed a circle and with a little body syntonic guidance ...

    https://runestone.academy/ns/books/published//TeacherCSP/CSPNameTurtles/bodySyntonic.html

    the student was able to come up with a procedure. Great learning opportunity lost if circle is already defined.

    If teachers are able to modify what library procedures are available to students, then when student needs some new command (circle, sin, cos, arc, summation, iseq, memberp) they can have the opportunity to actually program something useful for themselves.

    Then when the intro course ends and the advance course begins, the teacher can then enable the professional quality definitions of those procedures and make then known to the students. Who, then, can start using them as scaffolding for higher level stuff.

     

    Last edit: DanielAjoy 2022-01-27
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • David Costanzo

    David Costanzo - 2022-01-29

    Daniel Ajoy writes:

    I wonder if there is a way to know whether FMSLogo will be able to load a definition from the library or not.

    FMSLogo loads the library procedures from the "logolib" directory. If a procedure has already been defined, then FMSLogo will not try to load it from logolib.

    To know if something a library procedure, you can look in your logolib directory. This can be done through Windows Explorer or programmatically. It's safe to assume that FMSLogo can load any of the files in there and that doing so will load a definition for a procedure of the same name.

    A way that that's not as good is to do something like this

    :::text
    SHOW AND DEFINED? "CIRCLE NOT PRIMITIVE? "CIRCLE
    

    The problem with this approach is that it'll output "TRUE for user-defined procedures.

    Daniel Ajoy writes:

    Or even a way to preemptively load library definitions so that when a student tries to create a new procedure FMSLogo responds with:

    Running DEFINED? "CIRCLE loads it. This will stop TO from defining it from the commander, but there's no way to stop a programmer from using EDIT to change the definition.

    Daniel Ajoy writes:

    If teachers are able to modify what library procedures are available to students,

    A teacher with administrative rights can add or delete procedure definitions from logolib or use REDEFP and ERASE in startup.logoscript to remove a primitive. A teacher is legally permitted to re-distribute this "derived work" if they wanted to give this learning-enhanced FMSLogo to students. Of course, a teacher is also legally permitted to modify the source code to customize FMSLogo to meet their educational goals.

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

    Manfred Zindel - 2022-01-31

    Sorry for not keeping in contact for some weeks - but this will end soon.
    I think this discussion here is really interesting. If you need a headline for it, I'd propose:
    Opening Pandora's box.

     
    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
MongoDB Logo MongoDB