Re: [Factor-talk] Saving an image file with extra vocabularies loaded

2020-11-29 Thread Alexander Ilin
at 5:56 AM, Alexander Ilin <ajs...@yandex.ru> wrote: Here's the full code for .factor-rc: USING: listener namespaces sequences ;! Add math.ranges to the Scratchpad vocab of the Listener.interactive-vocabs [ "math.ranges" suffix ] change-global  29.11.2020, 16:50, "Alexand

Re: [Factor-talk] Saving an image file with extra vocabularies loaded

2020-11-29 Thread Alexander Ilin
Here's the full code for .factor-rc: USING: listener namespaces sequences ;! Add math.ranges to the Scratchpad vocab of the Listener.interactive-vocabs [ "math.ranges" suffix ] change-global  29.11.2020, 16:50, "Alexander Ilin" :See the SYMBOL: interactive-vocabs in the b

Re: [Factor-talk] Saving an image file with extra vocabularies loaded

2020-11-29 Thread Alexander Ilin
See the SYMBOL: interactive-vocabs in the basis\listener.factor. 29.11.2020, 15:25, "Alexander Ilin" :I think you need to somehow edit the vocabs preloaded into the Scratchpad vocab of the Listener. 29.11.2020, 12:07, "kevin" <kevinpat...@gmail.com>:Hello fellow Fact

Re: [Factor-talk] Saving an image file with extra vocabularies loaded

2020-11-29 Thread Alexander Ilin
I think you need to somehow edit the vocabs preloaded into the Scratchpad vocab of the Listener. 29.11.2020, 12:07, "kevin" :Hello fellow Factor users. Today, I finally became fed up with having to load the math.ranges vocabulary in the listener every time I want to use a word like [a,b].

Re: [Factor-talk] Peg Parser Definition

2020-11-22 Thread Alexander Ilin
have them, we could revisit it. Best,John.  On Sun, Nov 22, 2020 at 1:44 AM Alexander Ilin <ajs...@yandex.ru> wrote:Hello!  I'd like to use the peg.search vocab, and for that I need to pass it a parser.  Most of the parsing words in peg.ebnf produce either a quotation that is immed

Re: [Factor-talk] Peg Parser Performance

2020-11-22 Thread Alexander Ilin
If I remove all => actions, the time goes down to 120 seconds.  23.11.2020, 00:18, "John Benediktsson" :I suspect it’s a lot of “swap prefix >string” type stuff that’s different, but I can help you profile this a little later today or tomorrow.   On Nov 22, 2020, at 1:07 PM, Ale

Re: [Factor-talk] Peg Parser Performance

2020-11-22 Thread Alexander Ilin
diktsson" :When you run that in the listener it uses the non optimizing compiler.You should use the EBNF: word [=[ ... ]=] form and then refer to word for it to be a compiled parser.It’ll be much faster.Or wrap all that in a : foo ( — ) ... ;  On Nov 22, 2020, at 11:49 AM, Alexander Ilin <ajs

[Factor-talk] Peg Parser Performance

2020-11-22 Thread Alexander Ilin
Hello! I've got my first test results, and I'm having some doubts. The following code runs almost 200 seconds on a 20Mb file: "file-name.csv" [ utf8 [ input-stream get [ EBNF[=[ quotedColumn = "\""~ (!("\"") .)* "\""~ quotedColumn* => [[ first2 swap prefix

[Factor-talk] Peg Parser Definition

2020-11-21 Thread Alexander Ilin
Hello! I'd like to use the peg.search vocab, and for that I need to pass it a parser. Most of the parsing words in peg.ebnf produce either a quotation that is immediately called inline (EBNF[[), or produce a word that calls a parser hidden inside it (EBNF:). There are only two ways to

Re: [Factor-talk] Peg Parsing Files

2020-11-21 Thread Alexander Ilin
various aspects of what actually happened.So, the question is, is it possible to use the peg vocab to create this layered parsing architecture, where the first layer would consume a stream of file input, and the second would consume a stream of tokens from the first layer? 21.11.2020, 02:17, "Alex

[Factor-talk] Packrat Homepage

2020-11-20 Thread Alexander Ilin
Hello! Chris Double, why don't you announce the Factor implementation to the creator of packrat here? https://bford.info/packrat ---=--- Александр ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net

[Factor-talk] Peg Parsing Files

2020-11-20 Thread Alexander Ilin
Hello! I see that the peg vocab operates on strings. Can it operate on streams? I want to parse some log files, and thought it would make sense not to load them all at once. Especially since I want to stream multiple files concatenated as one. ---=--- Александр

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

2020-08-17 Thread Alexander Ilin
Mon, Aug 17, 2020 at 6:18 PM John Benediktsson <mrj...@gmail.com> wrote:>>>> https://docs.factorcode.org/content/word-change-at,assocs.html>>>> On Aug 17, 2020, at 8:31 AM, Alexander Ilin <ajs...@yandex.ru> wrote:>>>> Hello!>>>> I ca

[Factor-talk] ?change-value for assocs

2020-08-17 Thread Alexander Ilin
Hello! I came up with this code, because I could not quickly find an existing word for this. Did I miss it? If not, would it be a useful addition to the assocs vocab? ! If key exists in the assoc, change its value with quot. : ?change-value ( assoc key quot: ( value -- value' ) -- assoc' )

Re: [Factor-talk] concatenative.org

2020-08-17 Thread Alexander Ilin
because I was in there a year ago in a (failed) attempt to make auth support CouchDB in addition to SQLs. On Aug 4, 2020, at 3:45 PM, Alexander Ilin <ajs...@yandex.ru> wrote: No, that's why I'm asking. If you could give me a pointer into which vocabs implement the wiki authorization, I coul

[Factor-talk] Dwarf

2020-08-04 Thread Alexander Ilin
What is extra/dwarf? I see no docs, not even a summary, and git-blame reveals nothing useful. Is it related to the ELF format? ---=--- Александр ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net

Re: [Factor-talk] concatenative.org

2020-08-04 Thread Alexander Ilin
t it. I’ll need to take a look later tonight or perhaps tomorrow, but I can give you some pointers, because I was in there a year ago in a (failed) attempt to make auth support CouchDB in addition to SQLs. On Aug 4, 2020, at 3:45 PM, Alexander Ilin <ajs...@yandex.ru> wrote: No, that's why I'

Re: [Factor-talk] concatenative.org

2020-08-04 Thread Alexander Ilin
hanks!John.  On Aug 4, 2020, at 11:28 AM, Alexander Ilin <ajs...@yandex.ru> wrote:  Now that we have TOTP working, would it be a nice idea to protect the concatenative.org wiki with it? If we require all newly registered users to have TOTP enabled to login, would that help

[Factor-talk] concatenative.org

2020-08-04 Thread Alexander Ilin
Now that we have TOTP working, would it be a nice idea to protect the concatenative.org wiki with it? If we require all newly registered users to have TOTP enabled to login, would that help against the spam? ---=--- Александр ___ Factor-talk

Re: [Factor-talk] Qualified identifiers

2020-08-01 Thread Alexander Ilin
I could not figure out whether the `:` word creates the alias with the `vocab:` prefix, or it's somehow supported by the parser, so I didn't update the documentation for `:`, only for the `USE:` and `USING:` words. 01.08.2020, 22:52, "Alexander Ilin" :Created PR #2320. 01.08.2020, 16

Re: [Factor-talk] Qualified identifiers

2020-08-01 Thread Alexander Ilin
Created PR #2320. 01.08.2020, 16:41, "John Benediktsson" :Good point. When that feature was added, probably the documentation was not improved in the places you mention. Let’s fix that!Best,John.  On Aug 1, 2020, at 6:29 AM, Alexander Ilin <ajs...@yandex.ru> wrote:  Hello!   

[Factor-talk] Qualified identifiers

2020-08-01 Thread Alexander Ilin
Hello! Is it documented anywhere that the Factor words can be qualified by prefixing them with the "vocab:"? This may be self-evident to people familiar with the Forth family of languages, but I studied Factor by its built-in documentation before any other such languages, and was quite

[Factor-talk] Package Factor into a DLL

2020-07-18 Thread Alexander Ilin
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? ---=--- Александр ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net

Re: [Factor-talk] Integer to Bytes

2020-06-05 Thread Alexander Ilin
:  uint64_t last_nano_count;176:  void primitive_nano_count();  On Fri, Jun 5, 2020 at 5:14 PM Alexander Ilin <ajs...@yandex.ru> wrote:Does it also return 8 bytes in 32-bit Windows? 06.06.2020, 01:09, "Doug Coleman" <doug.cole...@gmail.com>:Actually, I can be more helpful. ``na

Re: [Factor-talk] Integer to Bytes

2020-06-05 Thread Alexander Ilin
nt dup 4 >be be> = .f nano-count dup 8 >be be> = .t nano-count dup 128 >be be> = .t   ``log2 1 +`` will give you the required number of bits to store an integer. You will want to round up to a power of 8 bits or a power of two bytes. USE: math.bitwisenano-count dup dup log2 1 + bit

Re: [Factor-talk] Integer to Bytes

2020-06-05 Thread Alexander Ilin
Hello again!  My specific example is the following. I want to put the output of `nano-count` into a `byte-array`, which is fed into a hash. The current value of `nano-count` is one of the sources of randomness gathered from the system and poured into the hash. To convert the integer value into a

Re: [Factor-talk] Platform Max Int

2020-05-10 Thread Alexander Ilin
Thank you for the tips, Doug, I have used the code in my latest "sodium" PR. 23.03.2020, 03:13, "Doug Coleman" :You could do this: : SODIUM_SIZE_MAX ( -- x ) cell-bits on-bits ; where cell-bits gives 32/64 and on-bits turns them to ones.  On Sun, Mar 22, 2020 at 6:44 PM

Re: [Factor-talk] Is there a default way to generate the k-partitions of a sequence?

2020-04-26 Thread Alexander Ilin
Some thoughts out loud. So, basically we need to take the length of the input sequence N, and split it into k numbers >= 1, so that the sum total of them will be = N. Let's say N = 10, k = 3. What kind of outputs can we get? Start with major number M = N - k + 1 = 8. Here the list of combinations

Re: [Factor-talk] She-bang

2020-04-20 Thread Alexander Ilin
t the top you can just run it. > > $ cat hello > #!/path/to/factor > USE: io ; > “HELLO WORLD” print > > $ ./hello > >>  On Apr 20, 2020, at 4:10 PM, Alexander Ilin wrote: >> >>  Hey, guys! >> >>   I could not find this in the help. Does Factor s

[Factor-talk] She-bang

2020-04-20 Thread Alexander Ilin
Hey, guys! I could not find this in the help. Does Factor support she-bang style scripts? ---=--- Александр ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk

Re: [Factor-talk] Secure Memory

2020-04-12 Thread Alexander Ilin
.private:context vm:context memory>struct datastack>>     0 alien-cell alien-address 0xf unmask 32 + alien>native-string 2018-01-17 23:11 GMT+01:00 Alexander Ilin <ajs...@yandex.ru>:Doug and Björn, I'd like to point out the following use case for your consideration, and then you ca

Re: [Factor-talk] Secure Memory

2020-04-12 Thread Alexander Ilin
t;native-string 2018-01-17 23:11 GMT+01:00 Alexander Ilin <ajs...@yandex.ru>:Doug and Björn, I'd like to point out the following use case for your consideration, and then you can tell me if the selective zeroing of sensitive memory buffers by the GC makes sense. Some sensitive data is stored

Re: [Factor-talk] Integer to Bytes

2020-03-22 Thread Alexander Ilin
ent platform. What am I missing? 23.03.2020, 03:13, "Doug Coleman" :You could do this: : SODIUM_SIZE_MAX ( -- x ) cell-bits on-bits ; where cell-bits gives 32/64 and on-bits turns them to ones.  On Sun, Mar 22, 2020 at 6:44 PM Alexander Ilin <ajs...@yandex.ru> wrote:Hello!  I'm cre

[Factor-talk] Platform Max Int

2020-03-22 Thread Alexander Ilin
Hello! I'm creating the sodium library FFI for Factor, and I found the following definition in the Sodium C headers: #define SODIUM_MIN(A, B) ((A) < (B) ? (A) : (B)) #define SODIUM_SIZE_MAX SODIUM_MIN(UINT64_MAX, SIZE_MAX) I think SODIUM_SIZE_MAX is used as platform-dependent macro

Re: [Factor-talk] Plotting in Factor

2019-11-04 Thread Alexander Ilin
"ui.gadgets.charts.demos" run 04.11.2019, 10:11, "Sanjay Jain via Factor-talk" : > I am new to Factor and am planning to use Factor scientific and engineering > data analysis. I have noted that Factor supports words for matrix algebra and > BLAS as well as bignum. Is there a facility to plot

Re: [Factor-talk] logica -- a prolog-like library

2019-10-12 Thread Alexander Ilin
Hello! I like the idea, and I will definitely keep in mind that such a thing exists, but at the moment don't have a use for it. The words like "semper", etc. - is there a tradition behind it? I've never seen such terminology in computing before. 12.10.2019, 13:46, "KUSUMOTO Norio" : >

Re: [Factor-talk] Escapable each

2019-10-02 Thread Alexander Ilin
I like the LGBT reference, well done! : ) 02.10.2019, 16:14, "KUSUMOTO Norio" : >  2019/09/23 18:03、Alexander Ilin のメール: >>  Have you used the `backtrack` vocab for this? >>  https://re-factor.blogspot.com/2015/06/send-more-money.html > > I ported a Prolog p

Re: [Factor-talk] Escapable each

2019-09-23 Thread Alexander Ilin
Have you used the `backtrack` vocab for this? https://re-factor.blogspot.com/2015/06/send-more-money.html 23.09.2019, 10:43, "KUSUMOTO Norio" : >>  2019/09/22 20:21、Alexander Ilin のメール: >> >>  I use `loop` or `while`, depending on the details. > > Hello. Thank

Re: [Factor-talk] Escapable each

2019-09-23 Thread Alexander Ilin
Wow, this looks very cool! : )) 23.09.2019, 10:43, "KUSUMOTO Norio" : >>  2019/09/22 20:21、Alexander Ilin のメール: >> >>  I use `loop` or `while`, depending on the details. > > Hello. Thank you for your answer. > > I rewrote my program using `loop 'and `whil

Re: [Factor-talk] Escapable each

2019-09-22 Thread Alexander Ilin
I use `loop` or `while`, depending on the details. 22.09.2019, 13:05, "KUSUMOTO Norio" : > Hello all, > > 'each 'and' 2each 'are very useful for writing iterative processes, but > sometimes > I want to get out of a process before repeating it to the end under certain > conditions. > > I think

Re: [Factor-talk] Co-operative threading

2019-09-14 Thread Alexander Ilin
You open a file, read one line, then reopen the file and do the same again.Since you are reopening the stream, there's always data available, thus there is no reason to yield. 14.09.2019, 21:04, "murray.calavera--- via Factor-talk" :Hello all, I'm a bit confused about how threads work with IO in

Re: [Factor-talk] directly writing to pref-dim slot of gadget

2019-07-25 Thread Alexander Ilin
See the documentation for the `pref-dim` word.If you read/write the `pref-dim` slot for random gadgets, you will mess up the caching of the value and possibly the layout logic of the `ui.gadgets` vocab.It's OK to set the initial value if you don't want to override the `pref-dim*` method for that

Re: [Factor-talk] Executable version information

2019-06-18 Thread Alexander Ilin
> [ (file-version) ] [ 2drop f ] if ;  18.06.2019, 21:09, "John Benediktsson" :I don't think so, but that'd be a cool thing to add! https://docs.microsoft.com/en-us/windows/desktop/debug/pe-format On Tue, Jun 18, 2019 at 10:37 AM Alexander Ilin <ajs...@yandex.ru> wrote:Hello!

[Factor-talk] Executable version information

2019-06-18 Thread Alexander Ilin
Hello! Is there a vocab in Factor to extract the Version Information resource from an executable file on Windows? I'm writing an app that needs to know the "FileVersion" string from the "StringFileInfo" block. ---=--- Александр ___

Re: [Factor-talk] Transparent background texts and Windows Factor

2019-06-08 Thread Alexander Ilin
08.06.2019, 16:11, "Alexander Ilin" : > I have also pushed an experimental commit to support transparency in the > foreground text color. > It seems there is still an issue with the correct handling of foreground > color. For example, instead of light blue I get a yello

Re: [Factor-talk] Transparent background texts and Windows Factor

2019-06-08 Thread Alexander Ilin
I have also pushed an experimental commit to support transparency in the foreground text color. It seems there is still an issue with the correct handling of foreground color. For example, instead of light blue I get a yellow. 08.06.2019, 15:12, "KUSUMOTO Norio" : >>  2019/06/08

Re: [Factor-talk] Transparent background texts and Windows Factor

2019-06-08 Thread Alexander Ilin
I have updated the code. There was the "24 bits" missing after "3byte-array uint32_t deref", so the random top byte used to mix in with the transparency via "bitor". 08.06.2019, 15:03, "Alexander Ilin" : > Unfortunately, the posted code doesn't work as

Re: [Factor-talk] Transparent background texts and Windows Factor

2019-06-08 Thread Alexander Ilin
e-mail wasn't sent to the mailing list because I sent it direct. > I rewrite the wrong part and send it again. > > On 2019/06/05 22:24, John Benediktsson wrote: >>  Or clear the cache each time, so you don’t have to be lower level code... >>>  On Jun 5, 2019, at 4:24 AM, Alexand

Re: [Factor-talk] Recourse to Composure

2019-06-06 Thread Alexander Ilin
Hi, Jack!  I think what you are doing is really cool, and I would love to read the book one day! 06.06.2019, 15:16, "Jack Lucas via Factor-talk" :Yesterday I was trying to create this adjacency system for one of the games I'm working on.  I have no idea if this will stay like this,  but, at the

Re: [Factor-talk] Transparent background texts and Windows Factor

2019-06-05 Thread Alexander Ilin
p script-string>image drop > ] each > ] benchmark > gadget transparent-time>> > swap 100 / "%d ms" sprintf >>text relayout-1 ; > > uni-bench-gadget "gestures" f { > { T{ key-down { sym "1" } } com-

Re: [Factor-talk] Transparent background texts and Windows Factor

2019-05-30 Thread Alexander Ilin
Hello! I think I have figured out the algorithm for the image processing. I'm not sure if it's the same one that you came up with. https://github.com/factor/factor/issues/152#issuecomment-497292323 Also, I don't know if there are standard WinApi functions to perform the necessary

Re: [Factor-talk] Transparent background texts and Windows Factor

2019-05-29 Thread Alexander Ilin
Wow, you are making a very valuable contribution! Thank you very much for the effort you are making! It would be really great to have a solution for this issue. 29.05.2019, 05:39, "KUSUMOTO Norio" : > It seems that the direction to solve the problem is not wrong. > But, we will need to transfer

Re: [Factor-talk] Transparent background texts and Windows Factor

2019-05-28 Thread Alexander Ilin
Hello! 28.05.2019, 08:37, "KUSUMOTO Norio" : > Hello all, > > I've been researching for a while about Windows Factor's inability to > correctly render texts on > transparent backgrounds. I haven't solved the problem yet, but I've just come > to an idea. > I'd be happy to hear your opinions on

Re: [Factor-talk] Factor UI and Input Method

2019-04-10 Thread Alexander Ilin
nil is f, the canonical false value. 10.04.2019, 15:52, "KUSUMOTO Norio" : > Hmm, "text" may be a NSAttributedString. > I would like to return nil at validAttributesForMarkedText. > Can I express nil in the Factor code? How should I write it? > > -- > KUSUMOTO Norio > >>  2019/04/10

Re: [Factor-talk] key-up event on Windows Factor

2019-03-30 Thread Alexander Ilin
Hello! Nice investigation! 30.03.2019, 12:26, "KUSUMOTO Norio" : > It seems to me key-down and key-up events are not desirable, not only in > Windows Factor. > For example, on Mac Factor, when the "Q" key is pressed with a shift key, > gesture-logger > reports: > >   T{ key-down { sym "Q" }

[Factor-talk] make-pane with the prettyprinter

2019-03-19 Thread Alexander Ilin
Hello! The prettyprinter is pretty powerful, but can it be used to create rich-text GUIs? For example, is it possible to use the `flow` section to make the text in the following pane automatically adapt to the window width as user resizes the window? MAIN-WINDOW: set-version-window {

Re: [Factor-talk] Kungfuguration Files

2019-03-19 Thread Alexander Ilin
I love it how everything is so simple in Factor . Thank you! : )) 19.03.2019, 21:18, "Doug Coleman" :USE: ini-file :p On Tue, Mar 19, 2019 at 1:09 PM Alexander Ilin <ajs...@yandex.ru> wrote:Hello!  I need to load a configuration from a simple text file.  I would not want to emp

[Factor-talk] Kungfuguration Files

2019-03-19 Thread Alexander Ilin
Hello! I need to load a configuration from a simple text file. I would not want to employ anything too complex (XML), and the thing must work in a deployed application, into which I would not want to include the Factor compiler. Something like a traditional ini-file would work perfectly.

Re: [Factor-talk] key-up event on Windows Factor

2019-03-09 Thread Alexander Ilin
I confirm the same behavior on Windows 10, latest development build of 64-bit Factor. It doesn't depend on the numpad or on physical keys. For example, when I use the normal English/US layout, the keys for semicolon and comma (";" and ",") generate only the "key-down" events. Pressing "q" and

[Factor-talk] Mailing List

2019-02-26 Thread Alexander Ilin
Hello! This mailing list is not listed in the Community section of the README.md (https://github.com/factor/factor/blob/master/README.md). Is this or purpose (to fight spam), or an omission that should be fixed? ---=--- Александр ___

[Factor-talk] Drag-and-Drop

2019-02-26 Thread Alexander Ilin
Hello! Do we have any drag-and-drop gestures? I'd like to be able to drag a Factor tuple between different UI windows of one process (extra cool if it would work between processes, but not necessary). ---=--- Александр ___ Factor-talk

Re: [Factor-talk] How to use local variable

2019-02-04 Thread Alexander Ilin
This will work as you expected: USE: locals :: fnc ( -- ) 0 :> i! 3 [ i 1 + i! i . ] times ; fnc 1 2 3 04.02.2019, 09:17, "KUSUMOTO, Norio" : > Hello to all, > > I’m writing a hierarchical finite state machine library as my first Factor > program. > It seems to me that It works for once now!

[Factor-talk] [ drop ] if

2018-12-24 Thread Alexander Ilin
Hello! I notice that many times we do something with an object if a condition is true, and otherwise we drop it. Search for "[ drop ] if", and you'll find many instances of what I'm talking about, it's a fairly common occurrence. I am often tempted to use `when` in those cases, but it

Re: [Factor-talk] unexpected integer from a float sum

2018-12-18 Thread Alexander Ilin
USE: math.functions:round instead 18.12.2018, 15:14, "Georg Simon" : > Below I pasted a result from my listener I do not understand. > > The result of sum looks like 137.99 which is right. > But the integer I made out of it is 13798 which is wrong. > > A typed in 137.99 gives the result I expect.

Re: [Factor-talk] Path in graph, or something

2018-12-11 Thread Alexander Ilin
to separate vocab(s) when the code would get too big or would require extra scaffolding, tuples, etc. 11.12.2018, 05:49, "John Benediktsson" :We have some path finding stuff in the ``path-finding`` vocabulary, as well as some directed graph stuff in ``graphs`` vocabulary that is used by the

Re: [Factor-talk] maximum of a seq

2018-12-11 Thread Alexander Ilin
Hi, Peter! > Any reason why supremum-by and infimum-by are not on the "Searching > sequences" doc page? If you agree I can add these together with supremum > and infimum. A link in the help system would be useful, I think. I remember myself discovering those functions by word of mouth, after

[Factor-talk] Path in graph, or something

2018-12-10 Thread Alexander Ilin
Hey, guys! I have a new task, and I want to know if there are existing vocabs that can be employed for solving it. Let's say there are versions of a DB format, and there are quotations that can be executed to convert DB from one version to another. A bunch of these quotations are edges of

Re: [Factor-talk] maximum of a seq

2018-12-10 Thread Alexander Ilin
Hey there! Sure, you can ask us here. I'm on sick leave, so got plenty of time. Coincidentally, working on my Factor hobby project. What you're looking for is called supremum-by. Terminology is a bit uncommon. Look up supremum and infimum in the help system. 10.12.2018, 17:06,

Re: [Factor-talk] Some beginner questions with a focus on stack effects

2018-10-07 Thread Alexander Ilin
A shorter way to write `other-quote`: : other-quote ( quote -- quote' )   "''" = "``" "''" ? ; 07.10.2018, 15:21, "Alexander Ilin" :Hello, Luca!  Such a humble email, I could not leave without an answer. Questions like this are completely appropriate on this

Re: [Factor-talk] Some beginner questions with a focus on stack effects

2018-10-07 Thread Alexander Ilin
Hello, Luca!  Such a humble email, I could not leave without an answer. Questions like this are completely appropriate on this mailing list.  Here are a few changes I made to make your code compilable: WAS:: gather-input ( mapping -- seq\f )    readln ; CORRECT:: gather-input ( -- seq\f )   readln

Re: [Factor-talk] with-http-request* sometimes fails

2018-09-05 Thread Alexander Ilin
Hello! Have you tried removing the leading slash before the "https://;? 05.09.2018, 16:05, "Georg Simon" : > As it seems there are websites that make > >  with-http-request* > > throw an error : > > IN: scratchpad USING: http.client ; > > With > "/https://fussballimtv.de; [ . ]

Re: [Factor-talk] Factor 0.98 now available

2018-07-31 Thread Alexander Ilin
Hi, John! 31.07.2018, 20:12, "John Benediktsson" : https://re-factor.blogspot.com/2018/07/factor-098-now-available.html I think the line "ui.tools.listener: support Ctrl-Break interruption on Windows" should be in the Improved Libraries section, not in the New Libraries.Also, not sure about

Re: [Factor-talk] HOOK: Confusion

2018-07-28 Thread Alexander Ilin
’s failing when used by another vocab? I’ll look at that later. Little busy today.  Out of curiosity why would you want it to not use the io-backend variable? On Jul 28, 2018, at 1:20 PM, Alexander Ilin <ajs...@yandex.ru> wrote: I have now pushed a branch, which adds a single commit, compar

Re: [Factor-talk] HOOK: Confusion

2018-07-28 Thread Alexander Ilin
. For some reason I think it sometimes fails without it, but I can't prove it (even to myself) at the moment. 28.07.2018, 01:29, "John Benediktsson" :It shouldn't fail like that, so maybe there's an issue with reloads? Do you have a simple way to reproduce it? On Fri, Jul 27, 2018 at 10:20 AM

Re: [Factor-talk] Recursive Definition

2018-01-26 Thread Alexander Ilin
Ah, I see it in the notes: "if is executed as a primitive when preceded by two literal quotations". Sorry for the noise : ) 26.01.2018, 11:56, "Alexander Ilin" <ajs...@yandex.ru>: > Hello! > >   I was looking through the documentation, and something drew my att

[Factor-talk] Recursive Definition

2018-01-26 Thread Alexander Ilin
Hello! I was looking through the documentation, and something drew my attention. Definition IN: kernel : if ( ..a ? true: ( ..a -- ..b ) false: ( ..a -- ..b ) -- ..b ) ? call ; Definition IN: kernel : ? ( ? true false -- true/false ) rot [ drop ] [ nip ] if ; inline How is it

Re: [Factor-talk] How to test Factor

2018-01-24 Thread Alexander Ilin
Thank you, this is certainly useful! I've save this text in a file at my Factor repo.I seems like this should be somewhere in a wiki or in a text file (perhaps not in the Readme, but close to it). 24.01.2018, 22:39, "Björn Lindqvist" :Hello! I want to describe how to run Factors

Re: [Factor-talk] printf documentation

2018-01-19 Thread Alexander Ilin
n Benediktsson <mrj...@gmail.com> wrote:MACRO: always produces a quot. But when it's "called" it's whatever the stack effect of that produced quot is when it's expanded into the calling site.On Thu, Jan 18, 2018 at 12:36 PM, Alexander Ilin <ajs...@yandex.ru> wrote:O-kay... Let

Re: [Factor-talk] printf documentation

2018-01-18 Thread Alexander Ilin
know! (One idea is "input-only stack effects" which don't have an output, so you could do ``MACRO: printf ( string ) ... ;``) On Thu, Jan 18, 2018 at 2:36 PM Alexander Ilin <ajs...@yandex.ru> wrote:O-kay... Let me try to ask my question again... I've read the blog post that you linked to

Re: [Factor-talk] printf documentation

2018-01-18 Thread Alexander Ilin
eloping it would help: https://re-factor.blogspot.com/2011/08/printf.html  On Thu, Jan 18, 2018 at 4:32 AM, Alexander Ilin <ajs...@yandex.ru> wrote:Hello!  There are two similar words: printf and sprintf. They have similar stack effects, but different behavior.MACRO: sprintf ( format-str

[Factor-talk] printf documentation

2018-01-18 Thread Alexander Ilin
Hello! There are two similar words: printf and sprintf. They have similar stack effects, but different behavior. MACRO: sprintf ( format-string -- result ) leaves a string on stack MACRO: printf ( format-string -- quot ) leaves nothing on stack despite the stack effect specified How come

Re: [Factor-talk] Disassembly

2018-01-17 Thread Alexander Ilin
Hello, Björn! Thanks for the explanation! I've already lost hope of seeing a reply to that, but you appeared out of nowhere and saved the day. Thank you! Are you saying there was a different (better?) optimizer in the previous Factor releases? What happened to it? 17.01.2018, 22:25, "Björn

Re: [Factor-talk] Secure Memory

2018-01-17 Thread Alexander Ilin
use finalizers. I think it would be better to use the destructors vocab to implement zeroing out of sensitive memory.     2018-01-16 23:17 GMT+01:00 Alexander Ilin <ajs...@yandex.ru>:Hello!  I was reading a manual on the `8th` language, and noticed an interesting feature.  Apparently, it

[Factor-talk] Secure Memory

2018-01-16 Thread Alexander Ilin
Hello! I was reading a manual on the `8th` language, and noticed an interesting feature. Apparently, it's possible to call a word on a memory buffer and thereby mark it as "sensitive information". GC would zero the memory upon release. Zeroing every bit of memory on release would add a

Re: [Factor-talk] concurrency.distributed under Windows

2018-01-07 Thread Alexander Ilin
Hello! 08.01.2018, 02:41, "John Benediktsson" :If you look at ``M\ remote-thread send``, it uses ``send-remote-message`` which opens a TCP connection using ``with-client``, which sends a message, then closes the connection. The code is 10's of lines to implement

Re: [Factor-talk] concurrency.distributed under Windows

2018-01-07 Thread Alexander Ilin
> So, it doesn't seem to be a runaway buffer issue, unless Factor does > something completely wrong, like peeking in the buffer and never removing > messages from it. Also, is it OK that I'm seeing hundreds of TCP connections being made between the processes? It seems like every individual

Re: [Factor-talk] concurrency.distributed under Windows

2018-01-07 Thread Alexander Ilin
Hello! 07.01.2018, 07:21, "Chris Double" <chris.dou...@double.co.nz>: > On Sat, Jan 6, 2018 at 1:18 PM, Alexander Ilin <ajs...@yandex.ru> wrote: >> It seems that I overloaded the system somehow, but I don't see me doing >> anything illegal. Can you guys help

[Factor-talk] concurrency.distributed under Windows

2018-01-05 Thread Alexander Ilin
Hello! I'm having further issues with the `concurrency.distributed` vocab. I was trying to pass some data between two Factor instances, but failed, even though the total data volume was about 2Mb. After spending some considerable time debugging my code (because I'm only learning to use this

Re: [Factor-talk] db.tuples in threads

2017-12-29 Thread Alexander Ilin
Hello! I have figured out what the issue with `no-defined-persistent` was. Turns out I called `object ensure-table` instead of `object class-of ensure-table`. 29.12.2017, 02:45, "Alexander Ilin" <ajs...@yandex.ru>: > Understood, thank you, Chris! > > In the en

Re: [Factor-talk] db.tuples in threads

2017-12-28 Thread Alexander Ilin
;: > The easiest way might be to use futures: > http://docs.factorcode.org/content/article-concurrency.futures.html > > eg: > > [ 42 ] future ?future . > => 42 > > On Thu, Dec 21, 2017 at 10:44 AM, Alexander Ilin <ajs...@yandex.ru> wrote: >>  Hello!

[Factor-talk] Wait for Thread

2017-12-20 Thread Alexander Ilin
Hello! If I spawn a thread using the threads:spawn word, is there a way to wait for the thread to finish its work? I need something like WaitForSingleObject(ThreadHandle, INFINITE). ---=--- Александр -- Check

[Factor-talk] Disassembly

2017-10-12 Thread Alexander Ilin
Hello! I'm trying to make sense of some disassembled code. Could someone help me out here? ``` IN: scratchpad [ 256 [ drop ] each ] disassemble 001a8dbcdfc0: 89053a30e8fe mov [rip-0x117cfc6], eax ! What's this? 001a8dbcdfc6: b80001mov eax, 0x100

Re: [Factor-talk] Backtracking

2017-10-08 Thread Alexander Ilin
Hello, John! 08.10.2017, 07:46, "John Benediktsson" :Regarding unsafe-amb.  You should use ``amb-lazy`` in compiled words.  Here's a simple version that prints all solutions. As I said, a perfect solution! Thanks for the `amb-lazy` hint. ---=---Александр 

Re: [Factor-talk] Backtracking

2017-10-08 Thread Alexander Ilin
Hello, Alston! 08.10.2017, 06:55, "CW Alston" :The solution to the puzzle that I wrote doesn't use `amb`. I approached the problemwith `math.combinatorics` & `math.ranges` instead, so I'm not much help there.But I had to wrestle with the same conundrum, regarding compilation

Re: [Factor-talk] Backtracking

2017-10-08 Thread Alexander Ilin
Thank you for the reply, and for the code suggestions! 08.10.2017, 07:13, "CW Alston" :-for `last3` :IN: scratchpad { 1 2 3 4 5 6 } 3 tail spill-seq ! or something like it In fact, here's a non-MACRO:-way to do the same:: last3 ( seq -- X Y Z )3 cut* nip first3 ; inline !

[Factor-talk] Backtracking

2017-10-06 Thread Alexander Ilin
pyright (C) 2017 Alexander Ilin. ! See http://factorcode.org/license.txt for BSD license. USING: arrays backtrack combinators.short-circuit infix kernel locals math math.functions prettyprint scratchpad sequences sequences.private sets ; IN: andrew-task ! The task is to find digits A,

Re: [Factor-talk] unless-global-var

2017-08-23 Thread Alexander Ilin
Actually, a better name might be `do-once`, or `with-guard-var`, or similar. 23.08.2017, 13:30, "Alexander Ilin" <ajs...@yandex.ru>: > Hello! > >   I think I came up with a useful word. Don't we already have something of > this nature? > > : unles

[Factor-talk] unless-global-var

2017-08-23 Thread Alexander Ilin
Hello! I think I came up with a useful word. Don't we already have something of this nature? : unless-global-var ( guard-variable quot -- ) dupd '[ t _ set-global @ ] [ get-global ] dip unless ; inline ---=--- Александр

Re: [Factor-talk] Build Farm (was: Window Messages)

2017-08-21 Thread Alexander Ilin
Cool, I'll look into it ASAP. What's the reason for using Travis, then? For kicks? 21.08.2017, 18:17, "John Benediktsson" : > Yes, we have an entire continuous build system (you can look in > `extra/mason`). ---=--- Александр

Re: [Factor-talk] Build Farm (was: Window Messages)

2017-08-21 Thread Alexander Ilin
What was doing the builds before Travis? Was it Factor itself? Do we have a Factor implementation of a build farm (like we have a web server)? I'm currently thinking about hosting a Jenking build locally for myself. Does anyone have any experience in that area? 21.08.2017, 16:44, "John

  1   2   3   4   >