Talk:STXTRM
While the [
command would seem to make STXTRM easier to program than MSM, I suspect the fact that non-instructions are not copied from the bottom to the top any longer will make :
hard to use without losing the rest of the stack data, at least without combining it cleverly with |
. Also, I think there is no way to get the equivalent of Underload's a command, not that it is needed for Turing completeness. --Ørjan (talk) 01:02, 12 August 2013 (UTC)
Oh, I think I was wrong about this. I just realized you can use [[]]:,
and [[]]:/,
to get hold of raw [
and ]
characters even if in a literally balanced subprogram. From this it's not so hard to implement the analogy of Underload's a
command:
[[]]:,.[[]]:/,/.
This followed by :
gives you a command to preserve a (balanced) string for one iteration, and you can "quine" this to preserve indefinitely, thus getting around the non-copying of non-commands part:
[ ; [[]]:,.[[]]:/,/. ./ [[]]:,.[[]]:/,/. .: ] ; [[]]:,.[[]]:/,/. ./ [[]]:,.[[]]:/,/. .:
This makes me convinced that STXTRM is Turing-complete even without |
. You still cannot use :
directly for Underload ^
, though, because it messes up the order of evaluation.
With the help of |
I think you can simulate most Underload commands more directly, with a slightly more complicated encoding of Underload ()
:
[ |: [ A ] ] :|
will run subprogram A
immediately.
--Ørjan (talk) 19:11, 27 August 2013 (UTC)
Oh hm that is wrong, I forgot that just reversing [ A ]
makes it hit a ]
first. Should be fixable though. --Ørjan (talk) 23:50, 28 August 2013 (UTC)
[ [|:] , A [] ] :,|
should work. --Ørjan (talk) 23:56, 28 August 2013 (UTC)
Argh no, that of course breaks if A contains any []
characters. Looking awkward now. :( --Ørjan (talk) 23:58, 28 August 2013 (UTC)