"5 Things I Wish I Knew" - Macaulay2/Workshop-2015-Boise GitHub Wiki

  • From Dave Swinarski

    1. listForm command - we used it to get coefficients in Schur rings version 1.1
    2. select command
    3. partition(function, list) can be used to partition a list according to the values of a function
    4. Lists can be created with the syntax "for s in S list ( ... )" --- we don't always have to use the apply command
  • From Corey Harris

    1. If you're editing a file test.m2 in Emacs, add something like the following to the end of the file to be able to F11 super easily!

      end

      load "test.m2"

      -- lines you want to run

    2. To make a list of repeated terms do something like toList (4:'e') which gives ('e','e','e','e')

  • From Robert Williams

    1. .. can be used for more than making a simple sequence. It can also make a rectangluar block of sequences between two lists. e.g. {0,0}..{1,1} outputs ({0,0}, {0,1}, {1,0}, {1,1}) This is also useful for definining a large number of indexed variables with little code.