Ticket #1374 (closed bug: fixed)

Opened 12 years ago

Last modified 11 years ago

:immediate semantics have changed

Reported by: pmichaud Owned by:
Priority: normal Milestone:
Component: imcc Version: 1.9.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

The semantics of the :immediate flag on subs has changed since 1.4.0 (probably due to trying to get constant values to work). I'm not sure what the correct semantics are supposed to be now, how things are intended to fit together, or whether this is a problem that needs to be addressed with respect to the deprecation policy.

The following program exhibits differences between 1.4.0 and current trunk (r43120):

$ cat immediate.pir
.sub 'main'
    say 'entering main'
    say 'exiting main'
.end


.sub 'abc' :immediate
    $P0 = box 'executed abc'
    say $P0
    .return ($P0)
.end

.sub 'def' :immediate
    $P0 = box 'executed def'
    say $P0
    .return ($P0)
.end

$ RELEASE_1_4_0/parrot -o i.pbc immediate.pir
executed abc
executed def
$ RELEASE_1_8_0/parrot -o i.pbc immediate.pir
executed abc
executed def
$ trunk/parrot -o i.pbc immediate.pir
$ 

In Parrot releases 1.8.0 and earlier, :immediate subs in PIR always executed as soon as they were compiled. In 1.9.0 and current trunk, they sometimes appear to execute when compiled, and other times when the .pbc file is loaded.

Some clarification here (and possibly updates to pdd19) would be helpful.

Pm

Change History

Changed 12 years ago by dukeleto

Does adding :anon to :immediate trigger some black magic similar to how using ":load :anon" triggers black magic in PBC's?

Changed 11 years ago by plobsing

  • status changed from new to closed
  • resolution set to fixed

Due to recent work in IMCC, :immediate subs now always run on compilation, as they did in 1.8.

Note: See TracTickets for help on using tickets.