Nobody said this was a "Standard" program, but I'd like to know a
better way to handle it than putting a dummy definition in after
RESTORE.
DaR
On Fri, Feb 20, 2009 at 7:05 PM, Leon Wagner <leon_at_forth.com> wrote:
> It looks like you are trying to manipulate the return address in SAVE =
> and RESTORE. You can't do that in a Standard program. In both cases, =
> you begin with R> but you did not put anything on the return stack prior =
> to that.
>
>> -----Original Message-----
>> From: sftalk-bounce_at_forth.com=20
>> [mailto:sftalk-bounce_at_forth.com] On Behalf Of Dennis Ruffer
>> Sent: Friday, February 20, 2009 4:59 PM
>> To: sftalk_at_forth.com
>> Subject: [sftalk] What's this?
>>=20
>> I'm finding a strange problem with the pfDatabase plug-in I published
>> at: http://vf-plugins.googlecode.com/files/pfDatabase.zip. It
>> involves code that saves and restores the file information to the
>> return stack. The code is defined like this:
>>=20
>> : SAVE ( -- ) ( R: -- f# db# r# ) R> R# @ >R DB# @ >R F# @ >R >R ;
>> : RESTORE ( -- ) ( R: f# db# r# -- ) R> R> F# ! R> DB# !=20
>> R> R# ! >R ;
>>=20
>> This works fine, except when the RESTORE is immediately followed by a
>> ; to exit the definition. Then I get a PRIVILEGED_INSTRUCTION error.
>>=20
>> Now that I think about it, is there some tail recursion optimization
>> going on here? That would explain why it used to work and works fine
>> in gforth. Something rings a bell here, but I forget what to do about
>> it.
>>=20
>> DaR
>> ----------------------------------------------------------------------
>> sftalk_at_forth.com The SwiftForth programming discussion email list
>> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
>> For list command help, send subject "help" to sftalk-request_at_forth.com
>> Message archives are located at http://www.forth.com/archive/sftalk
>> ----------------------------------------------------------------------
>> This list is a forum for SwiftForth users. For product support and
>> bug reports, please send email to support_at_forth.com
>> ----------------------------------------------------------------------
>>=20
>>=20
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
> For list command help, send subject "help" to sftalk-request_at_forth.com
> Message archives are located at http://www.forth.com/archive/sftalk
> ----------------------------------------------------------------------
> This list is a forum for SwiftForth users. For product support and
> bug reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>
>
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Fri Feb 20 2009 - 17:13:37 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 07-Feb-2012. Archive updated nightly.