PRIVATE .. PRIVATIZE

68 views
Skip to first unread message

Craig Lindley

unread,
Nov 28, 2018, 12:17:27 PM11/28/18
to pforthdev
Today was the first time I have tried to use these pForth words and as a result I have a question. Should the words  bracketed by PRIVATE{  and }PRIVATE and followed up with PRIVATIZE be visible when I execute words?

Helmut Eller

unread,
Nov 28, 2018, 12:35:32 PM11/28/18
to Craig Lindley, pforthdev
The definitions defined between PRIVATE{ and }PRIVATE are visible from
the point of definition until PRIVATIZE.

E.g.

: foo 1 ; private{ : foo 2 ; }private foo . privatize foo .

should print: 2 1

Helmut

Craig Lindley

unread,
Nov 28, 2018, 1:42:47 PM11/28/18
to pforthdev
Yes I understand that. My question was should the privitized words be visible when the pForth word "words" is executed?

Phil Burk

unread,
Nov 28, 2018, 7:53:35 PM11/28/18
to pfor...@googlegroups.com
Privatize works by smudging the private words. That prevents them from being found by the compiler. I think that is a reasonable thing to do.

So the question is should WORDS display smudged words? Probably not. Seems like a bug.

Phil Burk


--
You received this message because you are subscribed to the Google Groups "pforthdev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pforthdev+...@googlegroups.com.
To post to this group, send email to pfor...@googlegroups.com.
Visit this group at https://groups.google.com/group/pforthdev.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages