typeof 3-cube in 3.2rc4

Questions and problems about using polymake go here.
jplabbe
Posts: 4
Joined: 23 Jan 2012, 10:51

typeof 3-cube in 3.2rc4

Postby jplabbe » 04 Jan 2019, 13:55

Hello polymake community,

I am following the tutorials on:

https://polymake.org/doku.php/tutorial/properties
https://polymake.org/doku.php/tutorial/ ... h_comments

I just installed a fresh polymake 3.2rc4 compiled on debian stretch with gcc 6.3.0 and I get:

polytope > $c=cube(3);
polytope > $t=typeof $c;
polymake: ERROR: Compilation error

This appears to be different from what the tutorial indicates. Is that normal? Did I compile polymake with an error?

The origin of this is coming from using polymake version 3.2 as the polymake interface in sage. The instance above is a source of failing tests.

Further, I have a question regarding quotes:
It seems that previously the command:

@foo=(F_VECTOR);

worked, while now it returns

"polymake: ERROR: Bareword "F_VECTOR" not allowed while "strict subs" in use"

and the quotes

@foo=("F_VECTOR");

seems to be necessary now. Is that possible? Does this follow from recent changes?

I would be very thankful for any leading information!

Best,
JP

User avatar
gawrilow
Main Author
Posts: 423
Joined: 25 Dec 2010, 17:40

Re: typeof 3-cube in 3.2rc4

Postby gawrilow » 05 Jan 2019, 00:34

$t=typeof $c;
This is an incorrect expression. The typeof keyword is used when one wants to construct a type without referring to any data instance, e.g. like this:

Code: Select all

typeof Polytope<Rational>
If you already have an object, its type can be obtained this way:

Code: Select all

$c->type
I'm quite dismayed by finding wrong code in our published tutorials. They should be checked on regular basis by our CI system. We'll investigate this mishap.
@foo=(F_VECTOR);

returns

polymake: ERROR: Bareword "F_VECTOR" not allowed while "strict subs" in use
This is expected behavior. Non-quoted words can be interpreted by perl as subroutine calls without arguments, which can lead to confusing results or incomprehensible error messages. Therefore this sloppy mode is disabled in polymake. Actually, this change is not that recent, it should be in effect since few years.

jplabbe
Posts: 4
Joined: 23 Jan 2012, 10:51

Re: typeof 3-cube in 3.2rc4

Postby jplabbe » 05 Jan 2019, 10:53

Dear gawrilow,

Thank you very much for your quick reply, I tried it and it works as I wanted. Great!

If I am not mistaken, the code

Code: Select all

$t = typeof $c;
was being used in polymake 3.0.X and before 3.1 was released, and it seemed to work without returning an error...

User avatar
gawrilow
Main Author
Posts: 423
Joined: 25 Dec 2010, 17:40

Re: typeof 3-cube in 3.2rc4

Postby gawrilow » 05 Jan 2019, 13:50

If I am not mistaken, the code ... was being used in polymake 3.0.X and before 3.1 was released
Surely, the tutorial was valid at the moment it had been written, but then it managed to fall through the testing grid, so that it was not adapted to later polymake changes. Repair action is in progress now.


Return to “Helpdesk”