Re: [Factor-talk] How to introduce factor to java programmers?

2017-06-16 Thread Sankaranarayanan Viswanathan
Glad you guys liked it. And, I did not notice that typo until you pointed it out - will fix. Thanks, Sankar -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://s

Re: [Factor-talk] How to introduce factor to java programmers?

2017-06-16 Thread Alexander Ilin
I totally agree, the presentation is VERY COOL!Great visual style, great accent on the details in small steps, great topics covered, no clutter. The only minor criticism is the use of the word "breath" instead of "width". If it wasn't some intentional joke, I would at least fix the typo in "brea_d_

Re: [Factor-talk] How to introduce factor to java programmers?

2017-06-16 Thread John Benediktsson
P.S., this is fun to show off too, also implemented as a library. USING: infix ; INFIX:: quadratic-root ( a b c -- x ) (-b+sqrt(sq(b)-(4*a*c)))/(2*a) ; It's a little fragile though, I just noticed it doesn't seem to let me output more than one value on the stack (-b +/- sqrt...)

Re: [Factor-talk] How to introduce factor to java programmers?

2017-06-16 Thread John Benediktsson
This is GREAT! I love the topics covered, the step-through approach, and the overall feeling. I bet that was a great presentation. Best, John. On Fri, Jun 16, 2017 at 5:09 PM, Sankaranarayanan Viswanathan < rationalrev...@gmail.com> wrote: > Hello Everyone, > > Thank you for your inputs. In th

Re: [Factor-talk] How to introduce factor to java programmers?

2017-06-16 Thread Sankaranarayanan Viswanathan
Hello Everyone, Thank you for your inputs. In the end, I decided to focus on the aspects of Factor that I was most amazed by when I first discovered the language last year. I presented yesterday, and it was received well. I think I kindled the interest of a few people who attended. The slide

Re: [Factor-talk] Prettyprinting Numbers

2017-06-16 Thread Alexander Ilin
You see? It could use some limelight! : ) Also, thanks for pointing out the `tools.memory` vocab. Not only will it provide some insight for me as to the memory use pattern for my DB-heavy apps, but also it uses some juicy words like `object-table.` Too bad those aren't documented, I might have disc

Re: [Factor-talk] Prettyprinting Numbers

2017-06-16 Thread John Benediktsson
Well, it looks like we have this more or less exact word in ``tools.memory:commas``, and something very close in ``money:format-money``. On Fri, Jun 16, 2017 at 4:38 PM, Alexander Ilin wrote: > Hello! > > Wow, this is way more general than what I came up with: > > ``` > : num>grouped-str ( n --

Re: [Factor-talk] Prettyprinting Numbers

2017-06-16 Thread Alexander Ilin
Hello! Wow, this is way more general than what I came up with: ```: num>grouped-str ( n -- str )    number>string 3 "," join reverse ;``` Maybe your code should be included in the prettyprinter or somewhere similar, next to `number>string`, perhaps? 17.06.2017, 02:33, "John Benediktsson" :Note: t

Re: [Factor-talk] Prettyprinting Numbers

2017-06-16 Thread John Benediktsson
Note: that word doesn't work properly for negative numbers. This is better: : number>string-with-commas ( str -- str' ) [ abs number>string "." split1 [ reverse 3 "," join reverse ] dip [ "." glue ] when* ] [ neg? [ "-" prepend ] when ] bi ; On Fri, Jun 16, 2017

Re: [Factor-talk] Prettyprinting Numbers

2017-06-16 Thread John Benediktsson
We don't have that kind of locale support right now, but you could use something like: : number>string-with-commas ( str -- str' ) number>string "." split1 [ reverse 3 "," join reverse ] dip [ "." glue ] when* ; On Fri, Jun 16, 2017 at 4:18 PM, Alexander Ilin wrote: > Hello! > >

[Factor-talk] Prettyprinting Numbers

2017-06-16 Thread Alexander Ilin
Hello! Is there a standard way to output a number with comma separators grouping the thousands? ``` 1,000,000 num>str-grouped "1,000,000" ``` ---=--- Александр -- Check out the vibrant tech community on on

Re: [Factor-talk] Native Exception MsgBox on Windows

2017-06-16 Thread John Benediktsson
You could look into vm/errors.cpp and see which is the lowest level error that you want to catch (``fatal_error`` maybe)? Your code would probably not be cross platform so you might need to add a hook you can implement on Windows. Perhaps change/use the ``abort()`` API. On Fri, Jun 16, 2017 a

Re: [Factor-talk] Image Signature

2017-06-16 Thread John Benediktsson
The VM has low level primitives: void load_image(vm_parameters* p); bool save_image(const vm_char* saving_filename, const vm_char* filename); I'm not sure if better to put it there or in the Factor code, but probably there because it gets called as part of the VM startup to load an image

[Factor-talk] Native Exception MsgBox on Windows

2017-06-16 Thread Alexander Ilin
Hello! I'd like to make Factor show a native MsgBox on any uncaught exception on Windows. For example, currently if you run without a console, you won't see the "Out of memory" message. I'd like to change that. Where should I look for the code that could handle that? Do you think it wo

[Factor-talk] Image Signature

2017-06-16 Thread Alexander Ilin
Hello! I'd like to be able to sign the factor image and verify the signature on startup. Wouldn't that be cool? Did anyone think in that direction? ---=--- Александр -- Check out the vibrant tech community o