Skip to main content
added 81 characters in body
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

As a starting point I'll write up what I found about these functions before. I'm hoping someone will take a better look at them and will write a more complete answer.


Spelunking in version 8,

Internal`AddPeriodical[Print["boo!"], 3]

Now you get a boo! every 3 seconds.

Internal`Periodicals[]

(* ==> {Print["boo!"]} *)

Now do

Internal`RemovePeriodical[Print["boo!"]]

to stop it.

Internal`Periodicals[]

(* ==> {} *)

Note that AddPeriodical and RemovePeriodical have HoldFirst.

Internal`$ThisPeriodical seems to be undefined during normal evaluations, while it is set to the currently executing periodical (wrapped in HoldForm) when a periodical is being executed.

Most (all?) of the version 8 functionality seems to be implementable in terms of these, provided that they work the same way in version 7 as in 8 (which I cannot test).

As a starting point I'll write up what I found about these functions before. I'm hoping someone will take a better look at them and will write a more complete answer.


Spelunking in version 8,

Internal`AddPeriodical[Print["boo!"], 3]

Now you get a boo! every 3 seconds.

Internal`Periodicals[]

(* ==> {Print["boo!"]} *)

Now do

Internal`RemovePeriodical[Print["boo!"]]

to stop it.

Internal`Periodicals[]

(* ==> {} *)

Note that AddPeriodical and RemovePeriodical have HoldFirst.

Internal`$ThisPeriodical seems to be undefined during normal evaluations, while it is set to the currently executing periodical (wrapped in HoldForm) when a periodical is being executed.

Most (all?) of the version 8 functionality seems to be implementable in terms of these.

As a starting point I'll write up what I found about these functions before. I'm hoping someone will take a better look at them and will write a more complete answer.


Spelunking in version 8,

Internal`AddPeriodical[Print["boo!"], 3]

Now you get a boo! every 3 seconds.

Internal`Periodicals[]

(* ==> {Print["boo!"]} *)

Now do

Internal`RemovePeriodical[Print["boo!"]]

to stop it.

Internal`Periodicals[]

(* ==> {} *)

Note that AddPeriodical and RemovePeriodical have HoldFirst.

Internal`$ThisPeriodical seems to be undefined during normal evaluations, while it is set to the currently executing periodical (wrapped in HoldForm) when a periodical is being executed.

Most (all?) of the version 8 functionality seems to be implementable in terms of these, provided that they work the same way in version 7 as in 8 (which I cannot test).

added 2 characters in body
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

As a starting point I'll write up what I found about these functions before. I'm hoping someone will take a better look at them and will write a more complete answer.


Spelunking in version 8,

Internal`AddPeriodical[Print["boo!"], 3]

Now you get a boo! every 3 seconds.

Internal`Periodicals[]

(* ==> {Print["boo!"]} *)

Now do

Internal`RemovePeriodical[Print["boo!"]]

to stop it.

Internal`Periodicals[]

(* ==> {} *)

Note that AddPeriodical and RemovePeriodical have HoldFirst.

I don't know what Internal`$ThisPeriodical isseems to be undefined during normal evaluations, but I suspectwhile it might have a special value duringis set to the execution ofcurrently executing periodical (wrapped in HoldForm) when a periodical is being executed.

Most (no time to spelunk more, sorry!all?) of the version 8 functionality seems to be implementable in terms of these.

As a starting point I'll write up what I found about these functions before. I'm hoping someone will take a better look at them and will write a more complete answer.


Spelunking in version 8,

Internal`AddPeriodical[Print["boo!"], 3]

Now you get a boo! every 3 seconds.

Internal`Periodicals[]

(* ==> Print["boo!"] *)

Now do

Internal`RemovePeriodical[Print["boo!"]]

to stop it.

Internal`Periodicals[]

(* ==> {} *)

Note that AddPeriodical and RemovePeriodical have HoldFirst.

I don't know what Internal`$ThisPeriodical is, but I suspect it might have a special value during the execution of a periodical (no time to spelunk more, sorry!)

As a starting point I'll write up what I found about these functions before. I'm hoping someone will take a better look at them and will write a more complete answer.


Spelunking in version 8,

Internal`AddPeriodical[Print["boo!"], 3]

Now you get a boo! every 3 seconds.

Internal`Periodicals[]

(* ==> {Print["boo!"]} *)

Now do

Internal`RemovePeriodical[Print["boo!"]]

to stop it.

Internal`Periodicals[]

(* ==> {} *)

Note that AddPeriodical and RemovePeriodical have HoldFirst.

Internal`$ThisPeriodical seems to be undefined during normal evaluations, while it is set to the currently executing periodical (wrapped in HoldForm) when a periodical is being executed.

Most (all?) of the version 8 functionality seems to be implementable in terms of these.

added 161 characters in body
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

As a starting point I'll write up what I found about these functions before. I'm hoping someone will take a better look at them and will write a more complete answer.


Spelunking in version 8,

Internal`AddPeriodical[Print["boo!"], 3]

Now you get a boo! every 3 seconds.

Internal`Periodicals[]

(* ==> Print["boo!"] *)

Now do

Internal`RemovePeriodical[Print["boo!"]]

to stop it.

Internal`Periodicals[]

(* ==> {} *)

Note that AddPeriodical and RemovePeriodical have HoldFirst.

I don't know what Internal`$ThisPeriodical is, but I suspect it might have a special value during the execution of a periodical (no time to spelunk more, sorry!)

Spelunking in version 8,

Internal`AddPeriodical[Print["boo!"], 3]

Now you get a boo! every 3 seconds.

Internal`Periodicals[]

(* ==> Print["boo!"] *)

Now do

Internal`RemovePeriodical[Print["boo!"]]

to stop it.

Internal`Periodicals[]

(* ==> {} *)

Note that AddPeriodical and RemovePeriodical have HoldFirst.

I don't know what Internal`$ThisPeriodical is, but I suspect it might have a special value during the execution of a periodical (no time to spelunk more, sorry!)

As a starting point I'll write up what I found about these functions before. I'm hoping someone will take a better look at them and will write a more complete answer.


Spelunking in version 8,

Internal`AddPeriodical[Print["boo!"], 3]

Now you get a boo! every 3 seconds.

Internal`Periodicals[]

(* ==> Print["boo!"] *)

Now do

Internal`RemovePeriodical[Print["boo!"]]

to stop it.

Internal`Periodicals[]

(* ==> {} *)

Note that AddPeriodical and RemovePeriodical have HoldFirst.

I don't know what Internal`$ThisPeriodical is, but I suspect it might have a special value during the execution of a periodical (no time to spelunk more, sorry!)

added 1 characters in body
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k
Loading
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k
Loading