medley icon indicating copy to clipboard operation
medley copied to clipboard

Loops: Loops library contains its own version of Masterscope files

Open rmkaplan opened this issue 3 years ago • 7 comments

From 1988. Unless there is something special, these should be removed

rmkaplan avatar May 11 '22 21:05 rmkaplan

I would suggest checking them carefully to see if they've been modified to help with MS queries about Loops objects...

nbriggs avatar May 11 '22 21:05 nbriggs

Good point. I did an initial source-compare of the loops MASTERSCOPE (1988) against the version from 1994, which is the ancestor of what we are now using.

CSBROWSER picks out a lot of differences, but it isn’t clear (yet) that they are significant. They differ in their comments, so I put in a flag in COMPARESOURCES to tell it simply to throw away all comments before it starts the compare.

But what still makes the picture obscure is that the loops version seems to have qualifed record expressions (fetch (FOO FIE) of X) in a number of places while the 1994 version and its current descendent have just (fetch FIE of X). Those differences are harder to suppress algorithmically—would require a revision deeper in the list-comparison function, to do something special with syntactially different but semantically equivalent fetch and replace forms.

It might be worthwhile (and generally a good idea in system code) first to qualify the fields in our current Masterscope version, and then do the compare to see if Loops has anything special (or better).

On May 11, 2022, at 2:07 PM, Nick Briggs @.***> wrote:

I would suggest checking them carefully to see if they've been modified to help with MS queries about Loops objects...

— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/770#issuecomment-1124295734, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJKPDOZTYVYG5OLL6RDVJQOP7ANCNFSM5VWGEVBA. You are receiving this because you authored the thread.

rmkaplan avatar May 12 '22 16:05 rmkaplan

But what still makes the picture obscure is that the loops version seems to have qualifed record expressions (fetch (FOO FIE) of X) in a number of places while the 1994 version and its current descendent have just (fetch FIE of X).

That would lead me to think that they used field names that were already in use in MS so unqualified fetches would result in an ambiguity if you tried to load both sources. I agree that it's much better to use fully qualified field names in system code.

nbriggs avatar May 12 '22 16:05 nbriggs

I made a pass about a year or so ago to eliminate ambiguous field names across all the system files, so that we could get a full-system masterscope database without lots of ambiguity failures (generic fields like LINE, FILENAME..). I don’t recall that the masterscope files themselves had an ambiguity problem. The loops guys may just have been more defensive.

On May 12, 2022, at 9:43 AM, Nick Briggs @.***> wrote:

That would lead me to think that they used field names that were already in use in MS so unqualified fetches would result in an ambiguity if you tried to load both sources. I agree that it's much better to use fully qualified field names in system code.

rmkaplan avatar May 12 '22 17:05 rmkaplan

BTW, only one function is actually different in MSANALZE, and 3 templates are different in MSCOMMON. Field qualification seems only to be an issue in the file MASTERSCOPE.

On May 12, 2022, at 10:05 AM, Ron Kaplan @.***> wrote:

I made a pass about a year or so ago to eliminate ambiguous field names across all the system files, so that we could get a full-system masterscope database without lots of ambiguity failures (generic fields like LINE, FILENAME..). I don’t recall that the masterscope files themselves had an ambiguity problem. The loops guys may just have been more defensive.

On May 12, 2022, at 9:43 AM, Nick Briggs @.*** @.***>> wrote:

That would lead me to think that they used field names that were already in use in MS so unqualified fetches would result in an ambiguity if you tried to load both sources. I agree that it's much better to use fully qualified field names in system code.

rmkaplan avatar May 12 '22 17:05 rmkaplan

It's probably the case that the current MSANALYZE and MSCOMMON supercede the versions in Loops, and the Loops versions should be deleted. There are relatively few differences, so it is worth doing a source-compare and inspecting the differences. I think is the best source of expertise of this comparison.

If you have a system built on the current master with the new GITFNS, and if you have a Loops clone at some path on your local disk, you can make a Loops project (see GITFNS.TEDIT) and then do (CSBROWSER '{GLOOPS}/library-src/MSCOMMON {GMEDLEY}/library/MSCOMMON)

(If the loops clone is in a sister of your MEDLEYDIR named git-loops/, then the project will be made automatically when GITFNS is loaded.

rmkaplan avatar May 13 '22 22:05 rmkaplan

The oldest MASTERSCOPE in the medley repo is dated 1994. The date on the Loops original library-src MASTERSCOPE was 1988. The Medley MASTERSCOPE has changes for MSFNTYPES with a comment OMS (FNS MSFIND MSEDITF MSEDITE EDITGETDEF) (VARS MSBLIP)

          ;; List of (FILEPKGTYPE FILEPKGTYPE GETDEF-fn MARKASCHANGED-fn) for types
          ;; that Masterscope knows how to analyze.  LOOPSMS, for example, adds
          ;; LOOPS constructs to this list using MADDANALYZE

There may be a later LOOPS than the one we started with, though. Since we started with Loops 2.0. I should test the MS functioning.

The code in MSANALYZE was one of my first attempts to edit any part of Medley after 30 years. And I think the addition to MSMACROPROPS of MACRO-FN was a mistake. Right now Masterscope adds a file package savable TEMPLATE of MACRO whenever it analyzes a DEFMACRO. The MACRO-FN property is only added when you have a compiled DEFMACRO -- there's a CL:MACRO-FUNCTION that can be used to find the (Common Lisp) macro-expander.

Now, a few years later and more up to speed I should relook. I'll make sure the MS files from loops are moved to loops/obsolete.

masinter avatar Aug 04 '22 03:08 masinter

I think the issue raised in this has been studied and now resolved interlisp/loops/pr/13

masinter avatar Aug 19 '22 21:08 masinter