[Factor-talk] Standard string representation protocol

2008-02-27 Thread Nikhil Marathe
Hello all, I'm new to factor, and I was wondering if there is an equivalent for Python's __repr__ or __str__ or Java's Object.toString(). I mean '.' and the pretty print module allow printing to stdout, but is there any word which just puts the representation on the stack. Thanks! Nikhil ---

Re: [Factor-talk] Standard string representation protocol

2008-02-27 Thread Doug Coleman
You can do number>string for numbers and unparse for most anything else. SYMBOL: foo foo unparse 24.5 number>string Doug On Feb 27, 2008, at 8:51 AM, Nikhil Marathe wrote: > Hello all, > I'm new to factor, and I was wondering if there is an equivalent for > Python's __repr__ or __str__ or Java

Re: [Factor-talk] Standard string representation protocol

2008-02-27 Thread Jorge Acereda
On Wed, Feb 27, 2008 at 3:51 PM, Nikhil Marathe <[EMAIL PROTECTED]> wrote: > Hello all, > I'm new to factor, and I was wondering if there is an equivalent for > Python's __repr__ or __str__ or Java's Object.toString(). > > I mean '.' and the pretty print module allow printing to stdout, but is > th

Re: [Factor-talk] Standard string representation protocol

2008-02-27 Thread Victor M.
You can do: [ { 10 20 30 } pprint ] string-out On Wed, Feb 27, 2008 at 4:00 PM, Jorge Acereda <[EMAIL PROTECTED]> wrote: > On Wed, Feb 27, 2008 at 3:51 PM, Nikhil Marathe <[EMAIL PROTECTED]> > wrote: > > Hello all, > > I'm new to factor, and I was wondering if there is an equivalent for > > Pyth

Re: [Factor-talk] Standard string representation protocol

2008-02-27 Thread Nikhil Marathe
You can do number>string for numbers and unparse for most anything else. > > SYMBOL: foo > foo unparse > > 24.5 number>string > > Doug > > I knew about number>string, but didn't bother to know unparse. Sorry. -- http://22bit

Re: [Factor-talk] Standard string representation protocol

2008-02-27 Thread Slava Pestov
Doug Coleman wrote: > You can do number>string for numbers and unparse for most anything else. unparse works on numbers as well (by calling number>string). Slava - This SF.net email is sponsored by: Microsoft Defy all challen