Post Reply 
Massaging output of 50g's FACTORS command
01-03-2015, 09:16 PM (This post was last modified: 01-03-2015 09:21 PM by Gilles.)
Post: #6
RE: Massaging output of 50g's FACTORS command
(01-03-2015 05:27 PM)Peter Murphy Wrote:  Hi Gilles,

Thanks for that nice program. Is the leading "1." the type against which each member of the list is compared?

Peter

The leading "1." is the number of arguments taken from the list for the DOSUBS command. That means that the sequence « DUP TYPE NOT {DROP} IFT » DOSUBS takes elements in the list one by one and returns a list

with your example : { 3 5. 2 3.}

3 DUP TYPE NOT {DROP} IFT is executed, returns nothing (3 is TYPE 28.)
5. DUP TYPE NOT {DROP} IFT is executed, returns (5. is TYPE 0).
2 DUP TYPE NOT {DROP} IFT is executed, returns nothing
3. DUP TYPE NOT {DROP} IFT is executed, returns 3.

So DOSUBS -> returns { 5. 3. )

For example
{ "a" "b" "c" "d" } 3. « + + » DOSUBS will return { "abc" "bcd"}
that means :take the arguments from the list 3 by 3 and concatenate {"a "b" "c" + +, "b" "c" "d" + +}
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Massaging output of 50g's FACTORS command - Gilles - 01-03-2015 09:16 PM



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