Post Reply 
(50g) String inside string manipulation, UserRPL
10-17-2016, 08:49 PM (This post was last modified: 10-17-2016 08:58 PM by Vtile.)
Post: #11
RE: (50g) String inside string manipulation, UserRPL
(10-17-2016 07:07 PM)DavidM Wrote:  
(10-17-2016 06:28 PM)Vtile Wrote:  *meh* still doesn't work, with more complex objects the stack will parse it wrong. I'll give up.

For simple things it works

Vtile, I'm still having difficulty understanding exactly what you're trying to accomplish.

Can you give a couple examples of source strings and how they should look after manipulation? It's not clear to me how this relates to your "choose window" comments, or how parsing is part of this mix. And is the context for this meant to be the results of a running program, or are you only asking about creating strings while in the editing process? I'm confused. Smile
I think I'm the most confused one here, haha. I need a few evening to test all things more, but here is a little story.

The confusion actually comes from the reason a few months ago I had an idea of creating a usrkey program that is assigned to one physical key on calculator. The grand idea were to create a choose box/list that have all the type related normal commands in it (Lin256 included) for easy stack manipulation etc. This is really simple one and can be just be written normally and attached to the desired key.

However in this form it wouldn't be too great, since it would be slow to use if the desired command would be middle of the list. So my though were that the first two options on the list would be two last chosen commands for fast use as many times you use a few times the same command, ie "to tag", "to list" or "Real to Int". (Note. This could be archieved by using variable in ram? or ie. home directory, but lets forget this for now) I did want it use itself as a variable to store the two last used commands so the solution would been that it needs to "recompile/parse" itself and change the two first values of the list of lists that is used as argument for CHOOSE command. Then return the updated program code to stack and attach it again to the physical key. (so inefficient, but cool) Then I started the journey fiddling with all sorts of type "hacks" trying to convert a string to program (with the << >> as Lib256 PRG/-> seems not to attach those) etc. etc. one major hick up were how this system handles the string when type conversions or editors etc. are used. Now I'm facing problems (I think, or I just made some mistake.. Most propably my brains are just melting Tongue ) in some of my test snippets that it doesn't still like "string of string" object at cases with some type conversion methods it explodes it to pieces as it finds first two quotation marks and refuges to believe that the second one is starting glypth for 2nd order string, not ending glypth. So it slices a bread while it should peel the onion (as is done with ie. lists with removing layer by layer the depth of list of lists). So yeah, I'm still OCD to this Quine (wikipedia is golden) style problem. I have a good feeling of list object and PRG/-> command atm., but propably it is a dead end after all. Smile

The string handling is just so annoying and the fact that there is no command (as far as I'm aware, which takes object and adds the program start and end glyphs in it.). I'm pretty sure that these problems would be a piece of cake with SysRPL with full control, but but.

I'm not sure about C$ n XXX maybe I'm not just figured out how to append it with .. wait a bit .. yep didn't work. SIZE needs a string(or integer) as argument, and OBJ/-> gets a hickup with ie. Global Name inside the X variable.
Code:
/<< DUP  SIZE /-> X Y /<< "C$ " Y " " + X + + OBJ/-> />> />>

.. What I mentioned a program that uses a table from IEC standard can be archieved without any string in string style of hack, my brains were just so stuckt in that above usrkey problem that I started to make this second one way too complicated. Normal UserRPL is enough for this case what I have scetched it to the paper so far.

I'm swimming in too deep water here, I'm afraid. Big Grin
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (50g) String inside string manipulation, UserRPL - Vtile - 10-17-2016 08:49 PM



User(s) browsing this thread: 1 Guest(s)