Re: [Factor-talk] Factor 0.100 now available

2024-09-13 Thread Jon Harper
Awesome ! thank you all for your continued involvement in this great project. A true test of proper version number ordering hehe, I'm sure our code properly parses the version string and orders numerically, not alphabetically ! Plus now we can finally start aiming for factor 0.200 !! Cheers, Jon L

Re: [Factor-talk] Factor 0.99 now available

2023-08-29 Thread Jon Harper
in, Alexandre > Rousseau, Aleksander Sabak, Arnaut Daniel, Ashish Kurmi, Benjamin Pollack, > Cat Stevens, Cecilia Knäbchen, Chris Double, Craig Allen, Dave Carlton, > David Flores, David Mindlin, Doug Coleman, Dusk Banks, Fred Alger, > Giftpflanze, Ikko Ashimine, Jack Lucas

Re: [Factor-talk] Handling keyboard input

2023-03-21 Thread Jon Harper
Hi, in terminals, the application interacts with text streams (0 stdin, 1 stdout, 2 stderr, and optionally others with higher numbers) so all you can get is text (including control characters). You can find documentation here https://docs.factorcode.org/content/article-streams.html . You should b

Re: [Factor-talk] Port on Z80 computers.

2021-11-24 Thread Jon Harper
Hi Yves, Unfortunately, I think that factor is not the language you are looking for. Although it has the same concatenative style as forth, it's not at all a lightweight language like forth. The runtime requires an OS for many things. It's a general purpose high level language with garbage collect

Re: [Factor-talk] May 5th

2021-04-22 Thread Jon Harper
sure ! How long have they been working on it ? How much time do they have left ? Jon On Thu, Apr 22, 2021 at 1:51 AM cat via Factor-talk wrote: > > I'm interested! > > > > ‐‐‐ Original Message ‐‐‐ > On Tuesday, April 20, 2021 12:04 PM, John Benediktsson > wrote: > > Hi everyone, > > We

Re: [Factor-talk] How to validate different formats in an array?

2020-12-07 Thread Jon Harper
You can see some solutions for AoC problems on the factor pastebin: https://paste.factorcode.org/ For day4, there are 2 examples, using 1&& ( https://docs.factorcode.org/content/word-1&&,combinators.short-circuit.html) or EBNF semantic actions ( https://docs.factorcode.org/content/article-peg.ebnf.

Re: [Factor-talk] Peg Parsing Files

2020-11-22 Thread Jon Harper
; Alternatively, there must be a simple way to "wrap" a random access file > stream with an array-like interface, right? Don't we have a class like that > somewhere? > > Like the reverse of and ? > > I will definitely use the tokenizers, thanks. > > 22.11

Re: [Factor-talk] Peg Parsing Files

2020-11-21 Thread Jon Harper
What you are describing reminds me of the built-in nesting of parsers with the ebnf tokenizer : https://docs.factorcode.org/content/article-peg.ebnf.tokenizers.html Not sure if it's really applicable to your use case though. As for streams, aren't packrat parsers backtracking (with memoization)?

Re: [Factor-talk] ?change-value for assocs

2020-08-17 Thread Jon Harper
I think Alex wanted the conditional execution of the quot. if the key doesn't exist in the assoc, change-at provides f as value, but still stores the newvalue in the assoc at the given key. Jon On Mon, Aug 17, 2020 at 6:18 PM John Benediktsson wrote: > > https://docs.factorcode.org/content/word-

Re: [Factor-talk] Package Factor into a DLL

2020-07-18 Thread Jon Harper
There's https://docs.factorcode.org/content/article-embedding.html (I never tried it) Le sam. 18 juil. 2020 à 13:12, Alexander Ilin a écrit : > Hello! > > Is it possible to create a DLL in Factor and define exported functions > that can be called from other Windows processes who load that DLL?

Re: [Factor-talk] She-bang

2020-04-21 Thread Jon Harper
It's in the docs, maybe not prominent enough though: https://docs.factorcode.org/content/article-cookbook-scripts.html at the bottom of the page Jon On Tue, Apr 21, 2020 at 2:14 AM Alexander Ilin wrote: > > Thanks for the quick reply! I think it should be in the docs, but either it's > self-evi

Re: [Factor-talk] Co-operative threading

2019-09-17 Thread Jon Harper
Last time I checked ( https://github.com/factor/factor/issues/1129 ), named pipes support wasn't ideal in factor.. Even if you don't use with-file-reader and call open and read directly, you won't get cooperative threading. You can get it from stdin and stdout because there's special support for th

Re: [Factor-talk] key-down/up event issues on gtk backend Factor

2019-04-08 Thread Jon Harper
Here are a little bit more detailed instructions to use the x11 backend in case you need them :) Start factor in command line mode: $ ./factor -run=listener Then run the command Doug gave scratchpad: USE: ui.backend.x11 Optionnaly, to make the change persist across restarts, save the image: scr

Re: [Factor-talk] Is indirect recursion possible in factor?

2019-03-28 Thread Jon Harper
You have to use 'DEFER:' ' Due to the way the parser works, words cannot be referenced before they are defined; that is, source files must order definitions in a strictly bottom-up fashion. Mutually-recursive pairs of words can be implemented by deferring one of the words in the pair allowing the s

Re: [Factor-talk] Finding helpful messages in stage 2 bootstrap

2019-02-05 Thread Jon Harper
Hi Jack, Can you post the full log somewhere on the internet? Jon Le mar. 5 févr. 2019 à 01:05, Jack Lucas via Factor-talk < factor-talk@lists.sourceforge.net> a écrit : > Hello all. I'm trying to rekludge together freebsd support for factor. > This has mostly involved trying to integrate some o

Re: [Factor-talk] Updating factor

2017-01-29 Thread Jon Harper
Regarding unit tests, I think there was some cleanup recently and everything is now done in the factor temp directory. Le 29 janv. 2017 10:56, "Alexander Ilin" a écrit : > Hello, Tim! > > 29.01.2017, 12:35, "Timothy Hobbs" : > > I tried to follow > > http://docs.factorcode.org/content/article-fi

Re: [Factor-talk] unclip performance on ranges

2017-01-26 Thread Jon Harper
Hi, instead of creating range-unclip, a simpler idea is to use unclip-slice. this article has some insights regarding unclip vs unclip-slice : http://docs.factorcode.org/content/article-sequences-slices.html You can also look at the word next-prime from math.primes http://docs.factorcode.org/conte

Re: [Factor-talk] subseq?

2017-01-21 Thread Jon Harper
Hi, How close is the next release ? I saw Slava's taunt on github https://github.com/factor/factor/issues/1783 :) Maybe revert it for 0.98 and go with this for 0.99 ? Code will break silently on this since the number of arguments is the same. Jon On Sat, Jan 21, 2017 at 12:27 PM, CW Alston wro

Re: [Factor-talk] Unwanted Closure?

2017-01-20 Thread Jon Harper
Also, your each2* can be implemented without local variables or closures: : each2* ( seq quot: ( prev next -- next' ) -- ) [ unclip-slice swap ] dip each drop ; inline Jon On Fri, Jan 20, 2017 at 8:23 PM, Jon Harper wrote: > When I run your code, I don't get what you sai

Re: [Factor-talk] Unwanted Closure?

2017-01-20 Thread Jon Harper
When I run your code, I don't get what you said: :: each2* ( seq quot: ( prev next -- next' ) -- ) seq unclip-slice :> elt! quot '[ elt @ elt! ] each ; inline { 1 2 3 } [ [ swap . . nl ] keep 10 + ] each2* 2 1 3 11 It's actually pretty close to what you wanted, you just swapped the prev and

Re: [Factor-talk] Ratio vs. Float

2017-01-20 Thread Jon Harper
code the first test succeeds, but the second one fails: >> > >> > ``` >> > { 15 } [ 10 20 middle ] unit-test >> > { -40.5 } [ -50 -31 middle ] unit-test >> > ``` >> > >> > 20.01.2017, 01:30, "Jon Harper" : >> > >

Re: [Factor-talk] Ratio vs. Float

2017-01-19 Thread Jon Harper
] unit-test > ``` > > 20.01.2017, 01:30, "Jon Harper" : > > Hi, > you have to use number= to compare numbers with different types. > http://docs.factorcode.org/content/word-number=,math.html > > Jon > > Jon > > On Thu, Jan 19, 2017 at 10:50 PM, Alexander

Re: [Factor-talk] Ratio vs. Float

2017-01-19 Thread Jon Harper
Hi, you have to use number= to compare numbers with different types. http://docs.factorcode.org/content/word-number=,math.html Jon Jon On Thu, Jan 19, 2017 at 10:50 PM, Alexander Ilin wrote: > Hello! > > I'm a bit confused. Why is following not true? > > `81/2 40.5 =` > > ---=--- > Ал

[Factor-talk] EBNF peg parser ensuring full parse

2017-01-17 Thread Jon Harper
Hi list, when using the peg.* parsing words to parse a sequence of elements, what is the best way to detect invalid input ? By default the parsing stops when rules don't match (end of input, or bad input), For example, consider the following case: "abaXbba" [EBNF rule= ("a" | "b")* EBNF] ! V{ "a"

Re: [Factor-talk] slice>seq

2017-01-10 Thread Jon Harper
dup seq>> like would work i guess. Or if you want an array, >array ? Jon Le 10 janv. 2017 22:01, "Alexander Ilin" a écrit : Hello! What's the word to convert a `slice` into a real chunk of its underlying sequence? I'm looking for something like this: : slice>seq ( slice -- seq ) [ from>>

Re: [Factor-talk] PDF

2016-12-20 Thread Jon Harper
Hi, there is http://docs.factorcode.org/content/vocab-pdf.html and its children. I haven't used it, but it is for example used to generate the docs in pdf using pdf streams. Jon Le 20 déc. 2016 08:39, "Alexander Ilin" a écrit : Hello! Is there a way to generate PDF documents from within Fa

Re: [Factor-talk] Floats

2016-12-13 Thread Jon Harper
It's in math.functions: ~ Le 13 déc. 2016 18:57, "Alexander Ilin" a écrit : > Hello! > > Is there a word for comparing two floats with a given precision? > > ---=--- > Александр > > > -- > Check out the vibrant t

Re: [Factor-talk] Data Visualization

2016-12-09 Thread Jon Harper
There's the Google charts api in extra/ for simple charts. or the graphviz vocab for graphs. Le 9 déc. 2016 21:21, "Alexander Ilin" a écrit : > Hello! > > Do we have any means of data visualization? > I need to plot various simple line x-y charts, don't want to go to R for > that. > > ---===

Re: [Factor-talk] Setting and getting struct and initializing slots

2016-12-06 Thread Jon Harper
Let me *provide* the info :) The following article documents struct classes : http://docs.factorcode.org/content/article-classes.struct.html You can use mostly the same syntax as TUPLEs : STRUCT: test-struct { i int initial: 42 } ; test-struct new dup . ! S{ test-struct { i 42 } } 17 >>i i>> .

Re: [Factor-talk] New parser discussion (continued)

2016-11-30 Thread Jon Harper
Hi, just heard today of tagged template literals in ES6: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals tag`foo ${bar}` which seem to work like what Doug had in mind. That's nice. I want to find some time to help with the new parser, which solves real problems (

Re: [Factor-talk] Libudis86.dll (Was: TYPED: Declarations)

2016-11-25 Thread Jon Harper
ong :) Jon On Fri, Nov 25, 2016 at 12:24 PM, Alexander Ilin wrote: > Hi! > > I have no idea what integer tagging is, but it's great that there is no > bug. > > To all: I still have the 32-bit buld of the DLL, which I'd like to make > available on the Factor Downl

Re: [Factor-talk] Libudis86.dll (Was: TYPED: Declarations)

2016-11-25 Thread Jon Harper
Hi, It's actually the correct data. All integers are shifted by 4 (hence the 28/60 discussions). The tag of integers was chosen to be 0 so that some operations (like +) dont' have to shift before and after. But some operations do have to shift their arguments to their actual values first. If you d

Re: [Factor-talk] Parsing Ratios

2016-11-24 Thread Jon Harper
Hi, the code for parsing ratios is in https://github.com/factor/ factor/blob/master/core/math/parser/parser.factor It's called by string>number (or base>) see ->numerator ->denominator ?make-ratio ?add-ratio Cheers, Jon On Thu, Nov 24, 2016 at 6:38 PM, Alexander Ilin wrote: > Hello! > > Idea

Re: [Factor-talk] GC Bug? (Was: Out Of Memory)

2016-11-24 Thread Jon Harper
`gc` command? > > The `clear` command makes sure the empty allocated arrays don't show up in > (and get referenced by) the UI. Or am I missing something. > > The question is quite practical for me, as when I work with big data sets > I also see that GC keeps hogging the

Re: [Factor-talk] Out Of Memory

2016-11-24 Thread Jon Harper
reproduce this in Win8.1 GUI listener: > > IN: scratchpad 50 2^ 0 > Cannot convert to fixnum: 1125899906842624 > > IN: scratchpad 25 2^ 0 > (success) > > IN: scratchpad 26 2^ 0 > Invalid array size: 67108864 > Maximum: 67108863 > 24.11.2016, 17:06, "Jon Harper

Re: [Factor-talk] Out Of Memory

2016-11-24 Thread Jon Harper
Hi, more precisely, the process is aborted (uses the vm 'fatal_error()' function): $ ./factor -run=listener Factor 0.98 x86.64 (1781, heads/master-d4528c36da, Tue Aug 16 17:00:11 2016) [Clang (GCC 4.2.1 Compatible Ubuntu Clang 3.4 (tags/RELEASE_34/final))] on linux IN: scratchpad 50 2^ 0 fatal_er

Re: [Factor-talk] Reading clipboard in a Factor script ?

2016-11-10 Thread Jon Harper
It should work with my suggestion, I had tested it on ubuntu : #! /home/jon/factor/factor USING: ui.clipboards ui io namespaces kernel system ; "B4: " print clipboard get [ clipboard-contents print ] when* flush [ "AF: " print clipboard get clipboard-contents print flush 0 exit ] with-ui Chee

Re: [Factor-talk] Reading clipboard in a Factor script ?

2016-11-10 Thread Jon Harper
You need to initialize the UI. the with-ui ( http://docs.factorcode.org/content/word-with-ui%2Cui.html ) word does that. Note that with-ui setups an event loop and doesn't finish until the event-loop exists (when you close the last window), so you can call exit directly to force it to exit. Maybe y

Re: [Factor-talk] Questions of a newcomer

2016-11-07 Thread Jon Harper
Hi Peter, On Mon, Nov 7, 2016 at 3:07 PM, wrote: > Hello, > > I am tinkering with factor and was wondering if it is OK to pick your > brains here? As I play around with the language questions come up that > are probably easy for you to answer. I don't see much action on the > #concatenative IRC

Re: [Factor-talk] restricting ratio literals

2016-10-26 Thread Jon Harper
t makes the implementation better. If the > parser can be written in a simpler (and probably faster) way by > dropping support for ratios in uncommon bases, then let's do it. Tbh, > I don't think any ratios other than those on the format int1/int2 > needs to be supported. > >

Re: [Factor-talk] restricting ratio literals

2016-10-25 Thread Jon Harper
6 at 10:23 AM, Jon Harper wrote: > Hi list, > I'm reading the questions at https://github.com/factor/factor/pull/1362 > again > > I think we should only allow ratio literals in base 10. Currently we > support > 0xc+b/a or 0o4+7/3 or 0b1101+1101/110 but it looks u

[Factor-talk] restricting ratio literals

2016-10-24 Thread Jon Harper
Hi list, I'm reading the questions at https://github.com/factor/factor/pull/1362 again I think we should only allow ratio literals in base 10. Currently we support 0xc+b/a or 0o4+7/3 or 0b1101+1101/110 but it looks ugly. What do you think ? Jon ---

[Factor-talk] Restricting number bases conversion to 36

2016-10-24 Thread Jon Harper
Hi list, >From the docs, http://docs.factorcode.org/content/article-number-strings.html "Integers can be converted to and from arbitrary bases." Indeed, we have: IN: scratchpad 1835084090 9830 >base print i♥u and it round trips fine ! IN: scratchpad 1835084090 9830 [ >base ] [ base> ] bi . 183508

Re: [Factor-talk] Decimal equivalent of 0b 0o 0x ?

2016-10-21 Thread Jon Harper
According to https://rosettacode.org/wiki/Non-decimal_radices/Input at least perl 6, ruby and zkl have it. Jon On Fri, Oct 21, 2016 at 2:47 PM, Jon Harper wrote: > Hi list, > what do you think about adding support for a new '0d' prefix to input > numbers in base 10 ?

[Factor-talk] Decimal equivalent of 0b 0o 0x ?

2016-10-21 Thread Jon Harper
Hi list, what do you think about adding support for a new '0d' prefix to input numbers in base 10 ? It's rare in other programming languages (I know verilog has it in addtion to 'h and 'b) but the symmetry can be nice in some cases. Of course it would *not* replace the normal way of writing number

Re: [Factor-talk] Could not initialize OpenAL

2016-09-11 Thread Jon Harper
Openal works for me on Ubuntu 14.04 Le 12 sept. 2016 08:32, "Alexander Ilin" a écrit : Hello! Win 8x64, Factor 32-bit. I'm trying to run some demos, and they say I need alut.dll and openal32.dll, both of which I've downloaded and placed in the Factor.exe folder. When I click some of the butto

[Factor-talk] paste.factorcode.org

2016-09-11 Thread Jon Harper
Hey, trying to write a new paste on http://paste.factorcode.org , I'm getting 404 Not found Anyone knows what's up ? Jon -- ___ Factor-talk mailing list Factor-talk@lists.sourcef

[Factor-talk] prettyprinter number-base float errors

2016-09-11 Thread Jon Harper
Hi list, I'm working on factor's number parsing/printing. I'd like some inputs on the following problem: Basically the problem can be seen from this paste: http://pastebin.com/jxV8UKG2 : setting number-base to 2 or 8 gives pprint-errors for floats. So we have the number-base variable in prettypri

Re: [Factor-talk] Why doesn't my Factor receive the Insert key ?

2016-08-16 Thread Jon Harper
Hi, see this related issue: https://github.com/factor/factor/issues/1656 The following patch adds INSERT for gtk and x11: diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor index a10ad51..043db47 100644 --- a/basis/ui/backend/gtk/gtk.factor +++ b/basis/ui/backend/gtk/g

Re: [Factor-talk] Formatting Durations

2016-07-20 Thread Jon Harper
Regarding over engineering, I think that the composability of factor's libraries make the object allocations worth it. See https://docs.factorcode.org/content/article-cookbook-philosophy.html "Object allocation is very cheap. Don't be afraid to create tuples [...]". However, the restriction to tim

Re: [Factor-talk] slot fill in tuple border

2016-07-06 Thread Jon Harper
Looking at the code, it's used to compute the size of the child gadget when the border doesn't have it's preferred dimension. fill should be a pair of numbers between 0 and 1 which represent how the extra space is shared between the border and the child gadget on each axis. You can see it in actio

Re: [Factor-talk] Inverse of string-lines

2016-05-10 Thread Jon Harper
Also watch out for different line endings on different OSes :) Here's a discussion about string-lines, split-lines etc https://github.com/factor/factor/issues/1546 Jon On Tue, May 10, 2016 at 5:19 PM, John Benediktsson wrote: > I've wanted to rename string-lines to split-lines but I keep gettin

Re: [Factor-talk] OpenGL gadget question

2016-04-25 Thread Jon Harper
On Mon, Apr 25, 2016 at 1:46 PM, Alexander Ilin wrote: > 24.04.2016, 23:17, "Jon Harper" : >> Also, the opengl matrix stacks were part of the "fixed function >> pipeline". It was totally removed in openGL 4 and replaced by the >> programmable shaders. You

Re: [Factor-talk] OpenGL gadget question

2016-04-24 Thread Jon Harper
n, Apr 24, 2016 at 8:45 PM, Jon Harper wrote: > Hi, > do-matrix is a very thin wrapper around glPushMatrix and glPopMatrix > (https://www.opengl.org/sdk/docs/man2/xhtml/glPushMatrix.xml), so for > a theoretical explanation, I suggest you read about linear algebra > (how a

Re: [Factor-talk] OpenGL gadget question

2016-04-24 Thread Jon Harper
Hi, do-matrix is a very thin wrapper around glPushMatrix and glPopMatrix (https://www.opengl.org/sdk/docs/man2/xhtml/glPushMatrix.xml), so for a theoretical explanation, I suggest you read about linear algebra (how a matrix can represent a linear transformation such as a translation, a rotation, a

Re: [Factor-talk] ./build.sh

2016-03-19 Thread Jon Harper
With the move, everyone with a checkout older than 2016-03-15 (5dd6435511af) will have: $ ./build-support/factor.sh update [ ... snip ... git pul that removes the build-support.sh script ] build-support/_update.sh: line 3: /home/jon/factor/build-support/factor.sh: No such file or directory $ # no

[Factor-talk] bit-arrays docs

2016-03-19 Thread Jon Harper
>From the docs: http://docs.factorcode.org/content/article-bit-arrays.html "Bit arrays play a special role in the C library interface; they can be used to pass binary data back and forth between Factor and C. See Passing pointers to C functions." Is this still true ? If so, then there should be a

Re: [Factor-talk] move collect-by out of math.statistics

2016-03-08 Thread Jon Harper
ne ( seq -- assoc ) -[ f ] [ [ ] [ assoc-intersect ] map-reduce ] if-empty ; +[ f ] [ unclip clone swap [ assoc-intersect! ] reduce ] if-empty ; Jon On Thu, Feb 18, 2016 at 11:45 PM, Jon Harper wrote: > Yes I was thinking the same thing but then saw: > : assoc-combine ( seq -- unio

Re: [Factor-talk] How would I solve this better in Factor?

2016-02-29 Thread Jon Harper
o you write pseudo > code that is more expressible in factor or do you write traditional > imperative style pseudo code and then translate them to a factor > representation? > > Thanks, > Sankar > > On 2/25/16 12:01 PM, Jon Harper wrote: >> "Hi, >> I wrote

Re: [Factor-talk] How would I solve this better in Factor?

2016-02-25 Thread Jon Harper
"Hi, I wrote a basic o(n^4) solution to see how simple it could get. The code looks nice to me, but it's sllw :) like 1 hour on the 3200 chars string.. http://paste.factorcode.org/paste?id=3843 I noticed we have 1 function in common : remove-after-underscore. You can can see how head and when*

[Factor-talk] github repo

2016-02-23 Thread Jon Harper
I noticed the github repo moved from slavapestov/factor to factor/factor, everything (pull requests, issues, etc) should go there now ? Also there's still one pull request on slavapestov/factor. Jon -- Site24x7 APM Insigh

Re: [Factor-talk] CHAR: question

2016-02-22 Thread Jon Harper
exclamation-mark >> >> It works. However I can't seem to find the definition of the >> exclamation-mark word. I made a search in file contents, and it seems to >> only exist in the core\syntax\syntax-docs.factor, and in the factor.image >> files. >>

Re: [Factor-talk] CONSTANT: question

2016-02-22 Thread Jon Harper
Hi, The exact answer would be http://docs.factorcode.org/content/article-literals.html , for example: CONSTANT: CR-char-code 13 CONSTANT: LF-char-code 10 { 13 13 10 10 } ${ CR-char-code } ${ LF-char-code } replace However, in this case you can also use the "CHAR:" parsing word { 13 13 10 10 } { C

Re: [Factor-talk] adding http proxy support

2016-02-19 Thread Jon Harper
On Fri, Feb 19, 2016 at 4:05 PM, Jon Harper wrote: > So right now the ssl/tls is an optional dependency for the http > client. If we want to keep it that way, then I think the best solution > is to split io.sockets.secure into an io.sockets.secure-api which > defines t

Re: [Factor-talk] adding http proxy support

2016-02-19 Thread Jon Harper
b 5, 2016 at 8:05 AM, Jon Harper wrote: >> >> I don't really know, but >> >> http://stackoverflow.com/questions/15460819/what-is-the-difference-between-connection-and-proxy-connection-in-http-header >> says that "Connection" and "Proxy-Connection&qu

Re: [Factor-talk] move collect-by out of math.statistics

2016-02-18 Thread Jon Harper
27;t really "know" about hashtables, it provides the generic interface > (with the exception of assoc-combine). > > On Thu, Feb 18, 2016 at 11:48 AM, Jon Harper > wrote: > >> As a proof of concept, this patch bootstraps fine: >> http://paste.factorcode.org/pas

Re: [Factor-talk] move collect-by out of math.statistics

2016-02-18 Thread Jon Harper
@erg? >> >> There are also some good words in sequences.extras and assocs.extras that >> at some point I'd like to "promote" to core/basis. But I'm putting that off >> until after the next release. >> >> >> On Thu, Feb 18, 2016 at 10:15

[Factor-talk] move collect-by out of math.statistics

2016-02-18 Thread Jon Harper
Hi list, currently we have collect-by ( http://docs.factorcode.org/content/word-collect-by,math.statistics.html ) (and sequence>hashtable, sequence>assoc and some other mostly generic words) in math.statistics. They are a bit hard to find. Looking at the code, it looks like it would be a very sma

Re: [Factor-talk] adding http proxy support

2016-02-05 Thread Jon Harper
Looks like curl sends a Proxy-Connection, which since you know you're using > a proxy you could set in the request? > > On Fri, Feb 5, 2016 at 7:32 AM, Jon Harper wrote: >> >> I had environnement variables in mind as well but forgot to show them in >> the examples. So

Re: [Factor-talk] adding http proxy support

2016-02-05 Thread Jon Harper
> > $ http_proxy=http://10.0.0.1 python -c "import urllib; print urllib.getproxies()" > {'http': 'http://10.0.0.1'} > > We could also get fancier and have OS specific lookup like Python does for OS X and Windows as a fallback: > > https://docs.python.org/

[Factor-talk] adding http proxy support

2016-02-04 Thread Jon Harper
Hi list, I'm planning to add http proxy support to http.client. Here's the API I thought of, please feel free to give some feedback :) - add a "proxy" slot to the request object. (Or maybe subclass request as client-request and only add that slot to client ? I think that would be better for mainte

Re: [Factor-talk] OpenGL - How to draw lines interactively

2015-11-29 Thread Jon Harper
There's opengl.gl-line, used for exemple in ./extra/rosetta-code/animate-pendulum/animate-pendulum.factor Jon On Sun, Nov 29, 2015 at 2:07 PM, Georg Simon wrote: > I already have a gadget which responds to gestures. > > Which are the best words to use OpenGL for drawing simple lines one by > one

Re: [Factor-talk] Problem drawing an image in a new window

2015-11-29 Thread Jon Harper
There's an image-gadget implementation from images.viewer, maybe you should start from that and expand to get all the functionnality you need ? IN: scratchpad "resource:./misc/icons/factor_48...@2x.png" gadget. "resource:./misc/icons/factor_48...@2x.png" "image" open-window Jon On Sun, Nov 29

Re: [Factor-talk] Mutation on tuple instances

2015-11-26 Thread Jon Harper
care, since if those objects are mutated, the actual word definition will be changed, which is in most cases not what you would expect. Literals should be cloned before being passed to a word which may potentially mutate them. " Jon On Thu, Nov 26, 2015 at 5:50 PM, Jon Harper wrote: > On Thu,

Re: [Factor-talk] Mutation on tuple instances

2015-11-26 Thread Jon Harper
On Thu, Nov 26, 2015 at 5:28 PM, Sankaranarayanan Viswanathan wrote: > Hi, > > I'm having trouble understanding the behavior below: > > Running the code below on the listener: > > TUPLE: test a b c ; > : ( -- t ) { 1 2 } { 3 4 } { 5 6 } test boa ; > : f1 ( -- ) . ; > : f2 ( -- ) a>> [ [ 10 0 ]

Re: [Factor-talk] The iota test

2015-10-09 Thread Jon Harper
The graphical listener is simply not meant to be used like this. You can see that the command line listener (or a factor script, or a deployed program) has no problem outputting million of lines with ./factor -run=listener Jon On Fri, Oct 9, 2015 at 5:34 PM, Alexander Ilin wrote: > Hello! > >

Re: [Factor-talk] Ctrl+Break

2015-10-02 Thread Jon Harper
the same factor will most likely die. Similarly, if you do this with code that's doing a lot of IO, it probably won't work because the exception will happen in the wrong thread. Jon On Fri, Oct 2, 2015 at 1:34 PM, Alexander Ilin wrote: > Are we still talking about Factor on Windo

Re: [Factor-talk] Ctrl+Break

2015-10-02 Thread Jon Harper
You can also hit CTRL-C on the terminal, then press 't' to throw an exception in factor. If the listener is doing a busy loop, it will get the exception and it should work. If the exception goes to another thread because the listener thread yields, it can kill the whole process, so you have to use

Re: [Factor-talk] ALUT.dll

2015-09-17 Thread Jon Harper
For windows users, we try to host all the dlls on: - for 32bit http://downloads.factorcode.org/dlls/ - for 64bit http://downloads.factorcode.org/dlls/64/ Regards, Jon On Thu, Sep 17, 2015 at 9:46 AM, Alexander Ilin wrote: > Hello! > > I was trying to load the Lunar Rescue game in Factor, but

Re: [Factor-talk] Recursion

2015-09-15 Thread Jon Harper
> > On Tue, Sep 15, 2015 at 6:38 AM, Alexander Ilin wrote: > >> >> Is it possible that the recursive call to the numbers-game-loop would >> eventually overflow the call stack? >> >> And this article talks about it: http://docs.factorcode.org/content/article-tail-call-opt.html Jon --

Re: [Factor-talk] newbie question: how to collect info from a stream

2015-09-01 Thread Jon Harper
Hi, Here's a simple example: https://github.com/slavapestov/factor/blob/master/extra/tzinfo/tzinfo.factor It uses with-file-reader ( http://docs.factorcode.org/content/word-with-file-reader,io.files.html ) to bind the file stream to the default input stream. It then calls read and its variants an

Re: [Factor-talk] Why does editor pass some handled gestures?

2015-08-24 Thread Jon Harper
Nice investigation. This should go in the docs somewhere, particularly that parents gadget must pass gestures to the parent for the actions to work. For example in http://docs.factorcode.org/content/article-action-gestures.html ? diff --git a/basis/ui/gestures/gestures-docs.factor b/basis/ui/gestu

Re: [Factor-talk] Why does editor pass some handled gestures?

2015-08-19 Thread Jon Harper
Hi Georg, You have 2 problems in IN: scratchpad T{ key-down f f "C+c" } get-gesture-handler . f First, see http://docs.factorcode.org/content/article-keyboard-gestures.html for the correct syntax: IN: scratchpad T{ key-down f { C+ } "l" } get-gesture-handler . [ \ select-line invoke-command ] S

Re: [Factor-talk] gcc versions

2015-08-14 Thread Jon Harper
we using too-bleeding-edge C++ features? > > Is the suggestion maybe we scale down to some subset compilers have had > working for 3-4 years? > > > On Aug 14, 2015, at 10:51 AM, Jon Harper wrote: > > Well that's GCC 4.7.2 <https://gcc.gnu.org/gcc-4.7/> September 20, 20

Re: [Factor-talk] gcc versions

2015-08-14 Thread Jon Harper
correct, then we are all good. > > Doug > > On Fri, Aug 14, 2015 at 10:51 AM, Jon Harper > wrote: > >> Well that's GCC 4.7.2 <https://gcc.gnu.org/gcc-4.7/> September 20, 2012 >> Gcc did fix this in GCC 4.7.3 <https://gcc.gnu.org/gcc-4.7/> Apr

Re: [Factor-talk] gcc versions

2015-08-14 Thread Jon Harper
Well that's GCC 4.7.2 September 20, 2012 Gcc did fix this in GCC 4.7.3 April 11, 2013 Also, clang does not error on the implicit this, but crashes hard earlier than gcc :) $ clang --version Debian clang version 3.0-6.2 (tags/RELEASE_30

[Factor-talk] gcc versions

2015-08-14 Thread Jon Harper
Hi, for info, we can't compile the factor vm with the default compiler (gcc 4.7.2) of debian oldstable wheezy anymore. First, it has a false compilation error ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54277): g++ -c -x c++-header -Wall -DFACTOR_VERSION="0.98" -DFACTOR_GIT_LABEL="heads/master-

Re: [Factor-talk] Why does number>string append ".0" on my German system ?

2015-08-14 Thread Jon Harper
umbers in a Factor table. > > It would have been proper to display them locale dependant, but it is > not necessary for now. > > Am Fri, 14 Aug 2015 00:01:20 +0200 > schrieb Jon Harper : > > > So I looked into this, trying to solve it by calling printf through > > t

Re: [Factor-talk] Why does number>string append ".0" on my German system ?

2015-08-13 Thread Jon Harper
So I looked into this, trying to solve it by calling printf through the FFI with a locale setup and cleanup. The difficulty comes from the fact that printf is a variadic function.. Factor's ffi doesn't support them, at least no in a cross platform manner, right? So a workaround could be to wrap p

Re: [Factor-talk] Why does number>string append ".0" on my German system ?

2015-08-11 Thread Jon Harper
; a écrit : > Thank you. > > LC_CTYPE=C does not help. > LC_ALL=C gives "1.5" instead of "1,5" > My system is Ubuntu 14.04.2 LTS . > > But I can just wait for the fix. > > Georg > > Am Tue, 11 Aug 2015 09:37:31 +0200 > schrieb Jon Harp

Re: [Factor-talk] Why does number>string append ".0" on my German system ?

2015-08-11 Thread Jon Harper
This is being fixed. Meanwhile, you can adjust your locale settings to workaround: LC_CTYPE=C ./factor Should work. If not, you can try LC_ALL=C Jon Le 11 août 2015 9:30 AM, "Georg Simon" a écrit : > IN: scratchpad 1.5 number>string . > "1,5.0" > > I would have expected "1,5" > > > --

[Factor-talk] new parser

2015-08-07 Thread Jon Harper
Hi Doug, so I guess everyone has been teased with all the clues about the new parser :) 1fcf96cada0737 says "something else soon.", https://github.com/slavapestov/factor/issues/1398 mentions it, etc. Could you share your plans for the new parser ? How will it be different, what will it improve, et

Re: [Factor-talk] nested nil lists

2015-07-03 Thread Jon Harper
yes. Which is the same as ```nil 1list```. Jon On Fri, Jul 3, 2015 at 11:40 AM, Iain Gray wrote: > is nil nil cons ok? > > > On 3 Jul 2015, at 10:14, Iain Gray wrote: > > > > in Scheme I can evaluate (list ‘()) to get ‘(()) > > as a nested null list > > > > Factor supplies nil (+nil+) but I ca

Re: [Factor-talk] displaying Lisp like nested lists

2015-06-29 Thread Jon Harper
Looking at list>array, : list>array ( list -- array ) [ ] lmap>array ; You can adapt it to recurse on lists: IN: scratchpad : deeplist>array ( list -- array ) [ dup list? [ deeplist>array ] when ] lmap>array ; IN: scratchpad 1 nil cons 2 nil cons nil cons nil cons cons deeplist>array . { { 1 } {

Re: [Factor-talk] Exporting a C API

2015-02-10 Thread Jon Harper
This sounds like mixing the features from: - http://docs.factorcode.org/content/article-embedding.html which initializes everything, but then requires the compiler to use a string -> factor eval -> string call. - http://docs.factorcode.org/content/article-alien-callback.html which allows to directl

Re: [Factor-talk] ! Comments

2015-01-29 Thread Jon Harper
You're missing a whitespace between x and your closing parenthesis in ": dice5 ( -- x)" The error message should be better... Jon On Thu, Jan 29, 2015 at 12:04 PM, Alexander Iljin wrote: > Hello! > > I was trying to create a vocabulary: > > USING: random ; > IN: dice7 > > ! Output a random n

Re: [Factor-talk] ndrop

2015-01-28 Thread Jon Harper
Hi Alexander, The input quotations to “while” don't match their expected effects > Input Expected Got > [ dup 0 > ] ( ..a -- ..b ? ) ( x -- x x ) > [ 1 - swap drop ] ( ..b -- ..a ) ( x x -- x ) > > Regarding the first line: > These two lines can not be interpreted sep

Re: [Factor-talk] Standalone executables in Windows

2015-01-07 Thread Jon Harper
Looks like this thread: http://sourceforge.net/p/factor/mailman/message/6098094/ The tools now produce a single executable (the image is embedded in the executable). It also allows to strip unused vocabularies to reduce the size of the executable. But it's still the same tools that was cited in th

Re: [Factor-talk] Dealing with parts of a model

2015-01-03 Thread Jon Harper
Hi Mark, can't work with arrows. Among other reasons, in your case the arrow is not activated when it's data is used to intialize the editor string (that's why you see them empty). The model given to model-field isn't meant to be updated by the caller anyway: it's value is used as an initializati

Re: [Factor-talk] Model activation sequence

2015-01-03 Thread Jon Harper
Actually, the call to activate-model is just before the call to the gadget's graft* method, but the point remains the same Jon On Sat, Jan 3, 2015 at 8:02 PM, Jon Harper wrote: > Hi Mark, > I'm basing my remarks on > https://github.com/hyp

  1   2   3   >