package problem with "res"

10 views
Skip to first unread message

David Eisenbud

unread,
Aug 31, 2025, 9:47:09 PM (6 days ago) Aug 31
to maca...@googlegroups.com
Surely "res" (or resolution or freeResolution) is the most basic M2 command. But recently when I install or load packages, M2 complains that its 
 
stdio:1:16:(3): error: mutable unexported unset symbol(s) in package ResBug: 'res'
ResBug.m2:15:14-15:17: here is the first use of 'res'

Example below. How should this be handled?

--
David Eisenbud
Professor of Mathematics
University of California Berkeley

 newPackage(
         "ResBug",
         Version => "0.1",
         Date => "August 30, 2025",
         Headline => "problem with unexported res",
         Authors => {{ Name => "DE"}},
         DebuggingMode => true
         )

     export {"resFormat"}
     -* Code section *-

     resFormat = method()
     resFormat Module := M -> (
F := res M;
for i from 0 to length F list rank F_i)
     
     -* Documentation section *-
     beginDocumentation()

     doc ///
     Key
      ResBug
     Headline
      problem with "unexported" res
     Description
       Text
        How can this be fixed?
       Example
        S = ZZ/101[x,y]
M = coker vars SresFormat M
     
///
     -* Test section *-
     
     end--
     restart
     loadPackage "ResBug"
     restart
     installPackage "ResBug"     

David Eisenbud

unread,
Aug 31, 2025, 9:49:59 PM (6 days ago) Aug 31
to maca...@googlegroups.com
I pushed return and sent my previous message prematurely. The Dod section in my email has bad formatting,
but I believe that the formatting is correct in my emacs file, attached.

--
David Eisenbud
Professor of Mathematics
University of California Berkeley

ResBug.m2

Doug Torrance

unread,
Sep 1, 2025, 11:29:33 AM (6 days ago) Sep 1
to Macaulay2
The issue is that "res" is no longer exported by Core -- it's exported by whichever homological algebra package the user has loaded (the new Complexes or the old OldChainComplexes).

So one fix would be to add the HomologicalAlgebraPackage variable (whose value is the user's preferred complexes package) to PackageExports or PackageImports, e.g.,:

newPackage(...
    PackageExports => {HomologicalAlgebraPackage}
)

David Eisenbud

unread,
Sep 1, 2025, 12:11:54 PM (6 days ago) Sep 1
to maca...@googlegroups.com
Thanks, Doug! -- David

--
David Eisenbud
Professor of Mathematics
University of California Berkeley

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/macaulay2/75d80b1d-0c6f-4aa1-9a64-66e2090ce9a8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages