-
Notifications
You must be signed in to change notification settings - Fork 0
How To_CC2010
Example
f Sequence := identity
f(a,b,c) fails as does f((a,b,c))
So here is what you do. Method has a dispatch option --- more about dispatch is in the documentation.
g = method(Dispatch => Thing) g Sequence := identity g(a,b,c)
This works!
Having only one Thing for Dispatch means you want g to only look for 1 argument. There is a limit of 4 inputs --- reason is hardcoding in C.
if you do
g = method(Dispatch => {Thing, Type}) g(a,b)
returns an error since b is not a Type. g(a,ZZ)
now it has a problem with a, but not ZZ.
h = (a) -> -a
is a simple function where the () around the input variable a means you really only want 1 argument, but
h = a -> -a
will allow any number and type of arguments.
---- I need to get Dan's examples for this one. I fell behind. p = method (Options
You can document options as well in simple doc and there is no limit on the number of optional arguments. For example installPackage has a bunch. Type
options fun
to see the optional arguments available for fun.
You have a method that you want to do the same thing to a bunch of different types of arguments. How?
lists, and many other arguments are actually VisibleLists and so this might work well, as in,
t = method(Dispatch => Thing) t VisibleList :=
In short, and more generally, to apply the same exact method to more than one type, pick an ancestor class that contains all types of interest.
What is the difference between BasicList and VisibleList? and why is partition a BasicList and not a VisibleList?
BasicList is an ancestor class of VisibleList and thus has less functionality. If we look at what we can do with VisibleLists we might see what would be bad to accidentally do to a partition. To see that list type methods VisibleLists.
Maybe it should be a VisibleList? Maybe not.
Example
new List from Matrix := (List, m) -> entries m
This will make a standard syntax for type changes --- meaning that all type changes would be
new Blah from Booo
and this would do what one would expect.
Do we want "make" in the syntax rather than "new"? Many people see to like "make."
There is a file in the svn repository with everyone's name and so you can add ones that are appropriate under your name. This avoids conflicts in the file.
We would like the following to work,
"for i from (1,1,1,1,1) to (1,2,3,4,5) do "
While you are at it, why not "for i from 2 to -2 by -1 do"? We don't have that either. Dan is making a list of possible generalizations.
---- make comments about when
M_0 gives you the first generator, but not as a submodule. Then can do R*(M_0) which is a submodule and works as expected --- you can add, multiply by an ideal, and other fun things.
You can also get things as the image or kernel of a matrix.
To see that you have "the right thing" from a subquotient, use prune.
If I have a D-module that is homogeneous over the ring with n variables, then can I get a graded piece?
Good question. Maybe D-module code needs to be rewritten to work correctly --- e.g. take care of this situation. Could we then do pushForward in this situation? pushForward is, in general, being made more general.
-- First you need to install "subversion" --this will give you a program called svn. Macs already have this.
-- Now, make a directory to keep all the stuff from this workshop:
mkdir somedir
cd somedir
--Next you'll want to "check out" stuff that everyone has put into the repository. The command is "co" and you use it as follows:
svn co svn://svn.macaulay2.com/Macaulay2/workshops/Colorado-2010
-- Of course you can use the usual commands to get the contents:
ls
cd Colorado-2010
-- In order to add your own file to the repository, you need to do the following: add the file, and then check it in via "ci":
svn add Foo.m2
svn ci -m "this is where I put summary of what I've done to my file Foo.m2"
-- To update your directory run:
svn up
-- To see the changes made to the directory:
svn stat
-- To get the summary of the changes between your file and the version of the file someone else has checked in:
svn diff
-- Finally, if you want the latest version of everything including packages from previous workshops:
svn co svn://svn.macaulay2.com/Macaulay2/trunk M2
-- Then look inside
Macaulay2/packages/development/
-
Home
- Introduction
- Macaulay2 Contribution Guides
- Macaulay2 Workshop Guides
-
Macaulay2 Internals
- Building Macaulay2 from source
- Components of Macaulay2
- Case Studies
- Web servers
- Other
- Frequently Asked Questions
- Road map