[Factor-talk] https certificate for factorcode.org
Hi. The certificate for https://factorcode.org/ has expired. I don't know who is able to renew it, maybe it's time to use Let's Encrypt if the hosting provider allows it. Sam -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] From Factor to Swift to ???
2014-06-05 11:27 GMT+02:00 Dominikus Herzberg dominikus.herzb...@gmail.com : There is one person working at Google capable to create a competitor to #Swift and a replacement for #Java Scala seems to fit those two goals. Why invent yet another new language? Sam -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] n-slice
2013/4/14 mr w wzr...@gmail.com Could also imagine a slices-n word, that attempts to chop a sequence into slices of length n. How would that be different from sliced-groups? Is there an n-slices word, that attempts to chop a sequence into n slices? If you start with a sequence of length 6, how do you split it into 4 slices? 1 1 1 3? 2 2 2 0? 3 2 1 0? -- Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] A word similar to Haskell's 'iterate'
2011/12/6 missingfaktor rahul.phulore@gmail.com Does Factor have a word similar to Haskell's 'iterate' function? You may be looking for lfrom-by in the lists.lazy vocabulary. Note that the documentation is wrong (I'll submit a patch), the quotation has effect ( a -- b ), not ( -- n ). Usage : 1 [ 2 * ] lfrom-by 5 swap ltake listarray = { 1 2 4 8 16 } -- Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] conditional combinator proposal
2011/10/1 Slava Pestov sl...@factorcode.org Hi Michele, On Fri, Sep 30, 2011 at 2:53 PM, Michele Pes mp8...@rambler.ru wrote: To achieve this, I wrote this word: : when-drop ( obj question-quot: ( obj -- ? ) true-quot: ( obj -- ) -- ) -rot dupd call swapd [ call ] [ 2drop ] if ; inline Here is a simpler version that doesn't use locals: : when-drop ( obj question-quot: ( obj -- ? ) true-quot: ( obj -- ) -- ) [ dup ] 2dip [ drop ] if ; inline I think you forgot swap dip before [ drop ]. My version would be: : when-drop ( obj question-quot: ( obj -- ? ) true-quot: ( obj -- ) -- ) [ keep and ] dip when* ; inline -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2dcopy2___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Method overriding syntax in hierarchy
2011/7/24 Michele Pes mp8...@rambler.ru Hi factorers! I'm new to factor, but very interested. I have a tuple A, and a tuple B that derives from A (B A) If both have a method f and I have an instance of B, how can I call the method of the parent (A::f in c++ syntax) ? If you want to call A::f from B::f (as you are likely to do), you can use call-next-method : http://docs.factorcode.org/content/word-call-next-method,syntax.html Sam -- Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: math.primes:nprimes
My students asked for a nprimes word. Here it is. Sam The following changes since commit 4f8e8e6613be53786c9e72730b5577a9d2176247: Add math.primes:nprimes (2011-05-20 12:38:27 +0200) are available in the git repository at: g...@github.com:samueltardieu/factor.git for-slava -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Strange behaviour of odd?
This behaviour has been noticed indirectly by John Benediktsson who told me that 3.5 next-prime was causing an out of memory error. On Linux/64 bits: ( scratchpad ) 3.5 1 bitand 1 number= No suitable arithmetic method left3.5 right 1.0 generic bitand Type :help for debugging help. ( scratchpad ) \ odd? see IN: math : odd? ( n -- ? ) 1 bitand 1 number= ; inline ( scratchpad ) 3.5 odd? --- Data stack: t ( scratchpad ) 3.5 next-odd Out of memory Why is odd? accepting a non-integer argument while it should raise an exception? Sam -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Wikipedia page flagged for notability and possible deletion
Anyway, the pression (thanks to Chris, Zed, reddit) from the crowd has been enough: http://en.wikipedia.org/wiki/User:Christopher_Monsanto -- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] factorcode.org is down
Web server does not answer. Sam -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] newbie stuff
2010/12/28 Marcin Krol mrk...@gmail.com 1. is there some way to make Listener forget the code it just compiled? When I do smth like prog run it always runs the last compiled version, even if I just changed the source code file underneath. You can use refresh-all to have Factor recompile everything that has changed. 2. It would be neat to be able to cycle commands in scratchpad of Listener using up and down arrows. As it stands I have to click the relevant word sequence, which is irritating for me given the Linux shell and Unix/CPython shell habits. I think control-p control-n are supposed to work. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] newbie stuff
2010/12/28 Marcin Krol mrk...@gmail.com Now, if someone could explain to me why silly benchmark stopped working, I'd be grateful. Can't you just benchmark.struct-arrays run from the listener? The benchmark is in extra/benchmark/struct-arrays/struct-arrays.factor in the Factor distribution. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Planet Factor
Slava, could you add the Factor section of my blog to planet Factor? Name: An avian carrier's blog - Factor posts URL: http://www.rfc1149.net/blog/tag/factor/ Feed: http://www.rfc1149.net/blog/tag/factor/feed/ Also, maybe some other blogs could be removed from the planet or a better URL chosen with only Factor-related posts. Sam -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Git patch
2010/12/5 Jim mack j...@less2do.com Growing circulars had a problem pushing once rotated, so here's my attempt. I had trouble updating the read only seq slot, and expect there's a better way than my cheat, but it's beyond me for now.. It includes the test proving the need. This is my first attempt to fix anything, so please let me know what to do better. I tried forking a private repos and pushing to it, but got this and don't have time to monkey much more. fatal: bad object 541390b56187b99df4da5716b6987f9c051babe1 error: pack-objects died with strange error error: failed to push some refs to 'g...@github.com:jimmack1963/factor.git' and 20 min of google browsing didn't answer, so, here it is by email, which I think others have used recently. Jim, I fixed whitespace issues in your commit and set your name and email address: https://github.com/samueltardieu/factor/commit/c8b699a232e2baddefba643e84a8f790e7dc47cd If it looks right to you, slava can pull from git://github.com/samueltardieu/factor.git for-slava to get this change if he hasn't got it yet. Sam -- What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] erato off-by-one error.
2010/11/2 Jon Harper jon.harpe...@gmail.com I would accept Rupert's patch that makes sieve work with any integer 0 with no performance penalty, and change the documentation for sieve and marked-prime? to remove the restriction that the number should be odd. Samuel, what do you think ? Your proposal is indeed the best thing to do. Will you do it or do I need to? Sam -- Nokia and ATT present the 2010 Calling All Innovators-North America contest Create new apps games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] erato off-by-one error.
2010/11/2 Jon Harper jon.harpe...@gmail.com Sure, here are the patches (Rupert's included) A pullable repository would make things easier to explore :) I've put them in mine ( http://git.rfc1149.net/factor.git/shortlog/refs/heads/jon to browse). Here is the pull request (generated using git request-pull): The following changes since commit b973cfc3bb144b10a8478c9a62f0bf610dcafd85: game.loop: remove unneeded dependency on tools.memory vocab (2010-10-31 22:50:37 -0500) are available in the git repository at: git://git.rfc1149.net/factor.git jon Jon Harper (1): math.primes.erato doc fixes. Rupert Swarbrick (1): math.primes.erato: Fix off-by-one error basis/math/primes/erato/erato-docs.factor | 14 +- basis/math/primes/erato/erato-tests.factor |8 +++- basis/math/primes/erato/erato.factor |2 +- 3 files changed, 17 insertions(+), 7 deletions(-) -- Nokia and ATT present the 2010 Calling All Innovators-North America contest Create new apps games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] ch-upper? recent meaning change
2010/10/9 Slava Pestov sl...@factorcode.org The word was added by mistake and has been removed. You can use the following words: ascii:letter? ascii:LETTER? unicode.categories:letter? unicode.categories:LETTER? Perfect, thanks! -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull-request: documentation for assoc-refine
The following changes since commit ace41a6d61cbb1f57aefdb12248af07ed298993a: Fix bootstrap on mac by adding back the PF_INET constant (2010-10-09 16:53:54 -0700) are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (1): Add documentation for assocs:assoc-refine core/assocs/assocs-docs.factor |4 1 files changed, 4 insertions(+), 0 deletions(-) -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] ch-upper? recent meaning change
In change 2ef2372c87d3657ac0964c5f4e1ddfd5b28cf029 from last Wednesday, ch-upper? and ch-lower? were moved from unicode.case to ascii. The definition of ch-upper? is: : ch-upper? ( ch -- ? ) dup chupper = ; but the chupper now used is the one from ascii instead of the one from unicode.data. Before the change, we had: ( scratchpad ) CHAR: é ch-upper? . CHAR: É ch-upper? . f t while now we have: ( scratchpad ) CHAR: é ch-upper? . CHAR: É ch-upper? . t t which is obviously incorrect for é. It would probably be better to keep both versions (ascii and unicode.case) if we want ascii not to depend on unicode, or to drop the one in ascii as well as all the related words. Sam -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: fix two bugs in primes-between and primes-upto (math.primes)
The following changes since commit bd4fb9e6468c594c0111fceb1cc7c174254dc038: io.encodings.detect: detect empty files as utf8 rather than raise a sequence error (2010-06-10 17:32:56 -0700) are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (1): Fix primes-between and primes-upto with pathological bounds. basis/math/primes/primes-tests.factor |8 basis/math/primes/primes.factor | 15 ++- 2 files changed, 22 insertions(+), 1 deletions(-) -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Factor educational tools
Slava == Slava Pestov sl...@factorcode.org writes: Slava factorcode.org and concatenative.org, which are served by Slava Factor's http.server, run on linode.com. I'm not sure if it Slava qualifies as cheap (depending on the plan its $20 - $100 USD Slava per month) however they give you root access on a user-mode Linux Slava instance so you can do pretty much anything you want short of Slava installing a non-Linux OS. The main drawback in my experience is Slava that they're stingy with disk space and adding more is expensive, Slava so we use Dreamhost for downloads.factorcode.org. Just in case it is useful: rfc1149.net runs on a Kimsufi machine at OVH (France) and I'm quite happy for it. I host several domains and services. For 29,99€+VAT (35,87€) per month, that is around $50, you have a dedicated server with a 1.2G Celeron D, 2GB of RAM and 500GB or disk. You have a 100MB symetric network connection with no cap. And you can install whatever system you want (Linux, Solaris, *BSD, Windows). It also comes with a /64 IPv6 address block, 100GB of FTP storage for backups, a rescue system (which boots a minimal Linux system and launches a SSH server so that you can mount your partitions, chroot and fix a problem), and a virtual KVM (a Java applet lets you see and interact with your bootloader -- it uses virtualization). Your system is monitored and you get alerts if your server fails. Sam PS/ I am using an older offer of theirs at the same price, with 2x250GB of disk (Linux software RAID 1) and only 1GB of RAM. PPS/ Note that I am not a stakeholder at this company :) -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Factor educational tools
2010/3/29 Samuel Tardieu s...@rfc1149.net Slava == Slava Pestov sl...@factorcode.org writes: Slava factorcode.org and concatenative.org, which are served by Slava Factor's http.server, run on linode.com. I'm not sure if it Slava qualifies as cheap (depending on the plan its $20 - $100 USD Slava per month) however they give you root access on a user-mode Linux Slava instance so you can do pretty much anything you want short of Slava installing a non-Linux OS. The main drawback in my experience is Slava that they're stingy with disk space and adding more is expensive, Slava so we use Dreamhost for downloads.factorcode.org. Just in case it is useful: rfc1149.net runs on a Kimsufi machine at OVH (France) and I'm quite happy for it. I host several domains and services. For 29,99€+VAT (35,87€) per month, that is around $50, you have a dedicated server with a 1.2G Celeron D, 2GB of RAM and 500GB or disk. You have a 100MB symetric network connection with no cap. And you can install whatever system you want (Linux, Solaris, *BSD, Windows). And it looks like going through their UK-based service (instead of the French one) you can get it for $30/month: http://kimsufi.co.uk/ks/ There is an asterix near the unlimited traffic specification: ** : Traffic is unlimited. If you exceed 3 TB / month connection will be limited to 10 Mbps. Optionally, a flow rate of 100 Mbps (1Gbps or if you have opted for the 1G switchport) will be allocated for the purchase of additional traffic TB. £14.90 per additional TB -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: use sets
The following changes since commit 3ef79a67ac37cf929b5c45ac770cc9d11f53a9f8: Slava Pestov (1): alien.debugger: fix USING: form are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (1): Use sets extra/astar/astar.factor | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: Also test the derivation variant of astar
The following changes since commit b83f0d034990249dc53bc68e286dd8c978b25a75: Slava Pestov (1): tools.memory: fix unit test are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (1): Also test the derivation variant of astar extra/astar/astar-tests.factor | 33 +++-- 1 files changed, 19 insertions(+), 14 deletions(-) -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: more efficient astar implementation
The following changes since commit 6a6ab7c1a89c2529bc2b5416bc5b3ed7492465c6: Doug Coleman (1): Fix typedef typo in opencl are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (2): Project Euler : problem 265 Use a subclassed tuple with methods instead of quotations extra/astar/astar-docs.factor| 38 +- extra/astar/astar.factor | 39 +++--- extra/project-euler/265/265-tests.factor |5 ++ extra/project-euler/265/265.factor | 63 ++ extra/project-euler/project-euler.factor |2 +- 5 files changed, 129 insertions(+), 18 deletions(-) create mode 100644 extra/project-euler/265/265-tests.factor create mode 100644 extra/project-euler/265/265.factor -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] HTML parsing vocabulary
2010/3/8 Doug Coleman doug.cole...@gmail.com I had a better html parser but I reverted the code by accident... Incidentally, if you happen to revert some code that you had previously checked in, git reflog will allow you to get back any version for 90 days by default (git never deletes anything that it received, unless the afore-mentioned delay has expired). Sam -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: A* algorithm
The following changes since commit 3d3b6b610b3dd03f102fdd550c442a00639c4615: Joe Groff (1): Merge branch 'lexer-parsing-word-errors' are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (1): A* algorithm implementation extra/astar/astar-docs.factor | 42 ++ extra/astar/astar-tests.factor | 94 extra/astar/astar.factor | 67 extra/astar/authors.txt|1 + extra/astar/summary.txt|1 + 5 files changed, 205 insertions(+), 0 deletions(-) create mode 100644 extra/astar/astar-docs.factor create mode 100644 extra/astar/astar-tests.factor create mode 100644 extra/astar/astar.factor create mode 100644 extra/astar/authors.txt create mode 100644 extra/astar/summary.txt -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Factored Robot
2010/3/3 Jon Harper jon.harpe...@gmail.com I'm happy to show you these lines: Core bootstrap completed in 115 minutes and 42 seconds. Bootstrap completed in 115 minutes and 42 seconds. Bootstrapping is complete. My (very ancient) home machine seems blazingly fast to me when I read that :) -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Monotonic counters and Virtualbox on 64 bits Linux host
2010/3/3 Slava Pestov sl...@factorcode.org A similar issue occurs on Windows under VirtualBox. Doug and I tried a workaround similar to yours but it doesn't work too well if the Factor side of things doesn't poll the nano-counter often enough. Another solution would be to retry until the counter is indeed monotonic, with some kind of hard limit, as in: void factor_vm::primitive_nano_count() { - u64 nanos = nano_count(); - if(nanos last_nano_count) critical_error(Monotonic counter decreased,0); - last_nano_count = nanos; - ctx-push(from_unsigned_8(nanos)); + // Jump through hoops to get a monotonic value even when + // running from inside VirtualBox. + // http://www.virtualbox.org/ticket/6318 + for (int i = 0; i 8; i++) { + u64 nanos = nano_count(); + if(nanos last_nano_count) continue; + last_nano_count = nanos; + ctx-push(from_unsigned_8(nanos)); + return; + } + critical_error(Monotonic counter decreased,0); } as it looks like the counter sometimes goes backwards but doesn't jump far ahead. That should work best (at the price of more system calls in buggy situation) but is not 100% foolproof, even if the probability of failure when the system reports 8 misplaced values in a row is kinda low. Perhaps the best thing to do is to report this to the VirtualBox guys and wait for them to fix it. I reported it just after sending my mail: http://www.virtualbox.org/ticket/6318 In the meantime, we can accomodate a local patch to Factor. Sam -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Monotonic counters and Virtualbox on 64 bits Linux host
Jon and I have encountered a strange issue when using VirtualBox with 64 bits Linux hosts: the monotonic counter is not monotonic, with both 32 and 64 bits Linux guest systems. The attached program (compile with gcc -O2 -o t t.c -lrt) gives an error when executed onto the guest system with the following configurations: - Host: 64 bits Linux 2.6.29 x86_64 + VirtualBox 3.0.2, Guest: 32 bits Linux 2.6.32 i686 - Host: 64 bits Linux 2.6.32 x86_64 + VirtualBox 3.1.4, Guest: 32 bits Linux 2.6.32 x86_64 The monotonic timer jumps backwards in time, causing a critical error in Factor. I've implemented the following stupid hack that can be pulled from git:// git.rfc1149.net/factor.git for-slava: --- a/vm/run.cpp +++ b/vm/run.cpp @@ -16,7 +16,8 @@ void factor_vm::primitive_system_micros() void factor_vm::primitive_nano_count() { u64 nanos = nano_count(); - if(nanos last_nano_count) critical_error(Monotonic counter decreased,0); + if(nanos last_nano_count) + nanos = last_nano_count + 1; last_nano_count = nanos; ctx-push(from_unsigned_8(nanos)); } This does not seem to cause any trouble for Factor itself as the correction is a one-time shot every time the problem occurs, and lets us use Factor in VirtualBox with a 64 bits host. This should not change anything for systems functioning correctly (the test program does not exhibit the bogus behaviour when executed directly onto the host system). Sam -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] printing a sequence to STDERR
2010/3/1 Terrence Brannon scheme...@gmail.com I thought this would work, but would appreciate some help: { and a bottle of rum yo ho ho } [ error-stream get stream-print ] each You may need to flush the stream to see its output. Try: { and a bottle of rum yo ho ho } [ error-stream get [ stream-print ] [ stream-flush ] bi ] each Sam -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] attempting to write a document spell-checker yields out of memory
2010/3/1 Terrence Brannon scheme...@gmail.com ! I get an out of memory error with the document below when I call it with she hit her hard spell : spell ( string -- seq ) split spell ; Looks like a plain old infinite recursion to me. Didn't you mean (spell) instead? -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Adding a stack effect to a quotation
Jon and I were discussing earlier today of a way to use a dynamically built quotation with bi@ and other combinators. I suggested the word : add-stack-effect ( quot effect -- quot' ) [ call-effect ] 2curry ; inline so that we can call build-dynamic-quotation (( x -- y )) add-stack-effect bi@ Is there a better way to do it? Sam -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Adding a stack effect to a quotation
2010/2/26 Daniel Ehrenberg micro...@gmail.com Well, I think you could also do this: build-dynamic-quotation '[ _ call( x -- y ) ] bi@ Sure, this is equivalent.But we wanted to be able to tag several quotations with different stack effects, hence the separate word. However, you should reconsider whether you really need to build a dynamic quotation. Remember, building a quotation with curry and compose and fry doesn't necessarily make it dynamic. Agreed. I'll let Jon explain in which context he did it. I only assisted in answering a specific question :) Sam -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Rosettacode and amb
Jon == Jon Harper jon.harpe...@gmail.com writes: Jon Hi everyone, I wanted to use amb (one the of problems of Jon rosettacode.org) in factor, but I'm not sure if the solution I came Jon up with is good. Could you give some feedback ? Is there a Jon easier/more efficient way than the macro-map macro I wrote ? I added an annotation with a simpler (IMO) version: - no more macro: select recursively builds a candidate using amb - use 2all? instead of your convoluted reduce (you could have used 2map-reduce but 2all? will probably use shortcuts) - use CONSTANT: instead of an inlined word Jon The code is here (only the annotation) : Jon http://paste.factorcode.org/paste?id=1053#568 Also, as a personal style preference, I dislike words that do something useful *and* print the result unless a non-printing variant exist. I would have written something like: : search ( -- str ) words select dup sentence-match? [ fail ] unless join ; : search. ( -- ) search . ; MAIN: search. Amongst other things, this eases testing (although one can argue that redirecting standard output into a string is damn easy in Factor :-). Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Rosettacode and amb
Sam == Samuel Tardieu s...@rfc1149.net writes: Sam - no more macro: select recursively builds a candidate using Sam amb And as Jon noticed (in a private chat session), select is best defined as : select ( seq -- seq' ) [ amb-lazy ] map ; rather than using the constructive recursive version. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Factor Versus Forth --- the book
Hugh == Hugh Aguilar hugoagui...@rosycrew.com writes: Hugh Forth only ships a relative handful of words that have Hugh been found to be widely useful. One of these is star-slash the Hugh scalar. It is called that because it is typically used for scaling Hugh integer arithmetic. You use continued fractions to find rational Hugh approximations for real numbers, and this allows you to use Hugh integer arithmetic for the kind of calculations that are normally Hugh done in floating-point. The main advantage of */ is that it uses a double width for the intermediate result. Hugh A more modern microprocessor such as the PIC18 is also pretty Hugh simple, and would be another reasonable choice. PIC18 with their unique work register are pretty awful to work with. Trust me, I've written a Forth compiler for this architecture... -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Reorganize some code for simplicity
Hugo == Hugo Schmitt hug...@gmail.com writes: Hugo Hi again, what would be the best way to reorganize code like this Hugo (most Cairo functions take the same first argument): You may want to use cleave here, to get something like (untested): : hello-cairo ( -- ) { 100 100 } [ { [ T{ rgba f 0 0 0 1 } set-source-color ] [ 0 0 cairo_move_to ] [ 100 100 cairo_line_to ] [ 100 0 cairo_move_to ] [ 0 100 cairo_line_to ] [ 20 cairo_set_line_width ] [ cairo_stroke ] [ 0 0 50 50 cairo_rectangle ] [ T{ rgba f 1 0 0 0.8 } set-source-color ] [ cairo_fill ] [ 0 50 50 50 cairo_rectangle ] [ T{ rgba f 0 1 0 0.6 } set-source-color ] [ cairo_fill ] [ 50 0 50 50 cairo_rectangle ] [ T{ rgba f 0 0 1 0.4 } set-source-color ] [ cairo_fill ] } cleave ] make-png-image drop ; Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Come build with us! The BlackBerryreg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9#45;12, 2009. Register now#33; http://p.sf.net/sfu/devconf ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Filtering prime numbers
Scott == Scott Brown sukottobur...@yahoo.co.jp writes: Scott I have started learning Factor and after trying out the Scott palindrome tutorial, I am now trying to make a simple program for Scott filtering out non-prime numbers from a list. Scott I have made a word multiple-of? which returns true if x is a Scott multiple of y. Scott : multiple-of? ( x y -- ? ) [ = not ] [ mod 0 = ] 2bi and ; Scott I would like to use it filter a sequence of numbers like the Scott expression below, but looping through each of the numbers in the Scott sequence to remove its multiples, leaving only prime numbers. Scott { 2 3 4 5 6 7 8 9 10 } [ 2 multiple-of? not ] filter Scott Is there some loop or combinator that I could use to do this in Scott Factor? You can apply the filtering process with every number instead of just 2 by using `curry'. This word lets you insert an element into a quotation. For example, 2 [ multiple-of? not ] curry is equivalent to [ 2 multiple-of? not ] This way, you can build the quotation to give to filter for every number in the list by iterating with each: { 2 3 4 5 6 7 8 9 10 } dup [ [ multiple-of? not ] curry filter ] each You can check that it works as expected by using a longer list, from 2 to 50 for example: USE: math.ranges 2 50 [a,b] dup [ [ multiple-of? not ] curry filter ] each = V{ 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 } As a side note, you can obtain prime numbers more easily: USE: math.primes 50 primes-upto = V{ 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 } Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Come build with us! The BlackBerryreg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9#45;12, 2009. Register now#33; http://p.sf.net/sfu/devconf ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] reentrantvm win32 crashes
Phil == Phil Dawes p...@phildawes.net writes: Phil It turned out that on linux and wine the struct memory was zero'd Phil (which may be a fluke), but not on win32. In the factor c code Phil some flags were being tested before being initialized, which I Phil guess didn't matter when they were global vars. In particular Phil 'performing_compaction' had a random value when compiled with -O3 Phil which was causing the early crashes. Doesn't this appear using valgrind on Linux? Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: math.primes.factors:divisors
The following changes since commit 55ed9456a59fc97bcd55c609d9dab00109114501: Slava Pestov (1): Fix conflict are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (1): Add divisors to math.primes.factors basis/math/primes/factors/factors-docs.factor |6 +- basis/math/primes/factors/factors-tests.factor |4 +++- basis/math/primes/factors/factors.factor |6 +- 3 files changed, 13 insertions(+), 3 deletions(-) -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: better prime numbers packing
In a byte, it is possible to store primality information about 30 positive numbers, since modulo rules guarantee that in every 30-numbers slice (30n .. 30n+29) only the numbers equal to 1, 7, 11, 13, 17, 19, 23 or 29 modulo 30 can be prime (except 2, 3 and 5). This allows us to store more prime numbers using less space with a constant access time. I've also added tests for some words which didn't have them. The following changes since commit 3cd3d29d72120fda8b4bba1db1d85c466f4b6ac9: Slava Pestov (1): Merge branch 'master' of git://factorcode.org/git/factor are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (2): Pack primes numbers by slices of 30 Add extra tests for math.primes basis/math/primes/erato/erato-docs.factor | 10 ++ basis/math/primes/erato/erato-tests.factor | 11 +- basis/math/primes/erato/erato.factor | 46 +++- basis/math/primes/primes-tests.factor | 12 ++- basis/math/primes/primes.factor| 18 +- 5 files changed, 63 insertions(+), 34 deletions(-) -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Spurious dup in extra/io/serial/unix/linux/linux.factor
I also reindented the assoc. The following changes since commit 478e5cc95f5b22ca6b94cde742f3251c9bde481e: Slava Pestov (1): compiler.cfg.linear-scan: Debugging resolve pass are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (1): Remove spurious dup in io.serial.unix/linux extra/io/serial/unix/linux/linux.factor | 34 +++--- 1 files changed, 17 insertions(+), 17 deletions(-) -- Are you an open source citizen? Join us for the Open Source Bridge conference! Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] New here
Hugh == Hugh Aguilar hugoagui...@rosycrew.com writes: Hugh On the other hand, the downside of Factor is that the built-in Hugh data structures may not do exactly what you want them to Hugh do. Programming in Factor is like buying a suit off the rack; it Hugh is not going to be a perfect fit for your application. From my two years experience using Factor, I never had any problem defining any data structure I needed. And if by built-in data structures you refer to builtin types (as opposed to builtin type constructors), I fail to see what basic type would be missing. Could you please explain what you mean here? As a side note, I am also a big Forth supporter and wrote several Forth native and cross compilers that are used in production. But recently, I noticed that Factor combinators were so useful an abstraction that reimplementing them in my Forth compilers made me write even clearer and simpler code. For this reason, I wouldn't recommend learning Forth first as an helper step. Jumping right into Factor is the best way to catch Factor idioms early. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: automatic vocabulary loading when deserializing
In the lab session today, my students will have to be able to remotely execute quotations and will use the serialize vocabulary to transmit them. Unfortunately, if a word in the quotation is located in a vocabulary which has not been loaded yet, the deserialize will fail with an unknown word error. This small patch requires the needed vocabularies before attempting to lookup the word. The following changes since commit 6ff7e2cba75352d4b0eddc04dd0add12c8f21299: Slava Pestov (1): compiler.cfg.linear-scan: Fix a couple of bugs are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (1): Automatically load needed vocabularies when deserializing words basis/serialize/serialize.factor |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Treating tabs as whitespaces in source code
Sam == Samuel Tardieu s...@rfc1149.net writes: Sam Right now, tabs are not considered whitespaces between tokens in Sam source code. This has two implications: Sam Sam - it is possible to define a word called a b (with a tab in its Sam name) ; Sam Sam - it is impossible to use tabs to indent source code (not Sam that I like it, but some of my students where hit by this today). Sam I hope this is just a bug and not a feature :) On IRC, Slava answered that this was on purpose. What is the point of allowing tabs in identifiers? If we want to *forbid* tabs in source code (I dislike them, but some people's favorite editors will add some) wouldn't it be better to just say so in a clear error message? Here : : foo ( x -- x ) [ bar bar bar ] dip ; Complains that bar is not a word because of the leading tab. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Treating tabs as whitespaces in source code
Right now, tabs are not considered whitespaces between tokens in source code. This has two implications: - it is possible to define a word called a b (with a tab in its name) ; - it is impossible to use tabs to indent source code (not that I like it, but some of my students where hit by this today). I hope this is just a bug and not a feature :) The second patch fixes this, while the first one fixes a doc string (pull request sent last week but never integrated). The following changes since commit 6d8ce222de3af3717a912b3dd3dd88d7044eea1b: Slava Pestov (1): sequences: change implementation of interleave are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (2): Documentation fix for PV{ Treat tabs as blank characters when tokenizing basis/persistent/vectors/vectors-docs.factor |2 +- core/lexer/lexer-docs.factor |8 core/lexer/lexer.factor |2 +- 3 files changed, 6 insertions(+), 6 deletions(-) -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Wrong see output
see doesn't properly qualify words that could come from several vocabularies. In this example, it should either output u:swap or kernel:2drop. IN: u : swap ( -- ) ; USING: kernel ; QUALIFIED: u IN: t : foo ( -- ) 1 2 u:swap 2drop ; \ foo see USING: kernel u ; IN: t : foo ( -- ) 1 2 swap 2drop ; -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Fry and { }
Sam == Samuel Tardieu s...@rfc1149.net writes: Sam It looks like _ is not substituted within { } in a fry expression: Sam Sam ( scratchpad ) [ '[ { _ } ] ] infer. Sam ( -- object) Sam Sam It makes it difficult to use a case inside a fry. Is it on purpose? Ping? Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Pull Request
Slava == Slava Pestov sl...@factorcode.org writes: Slava Good job, a fast JSON parser would be very useful to have. Indeed, it will speed up the couchdb vocabulary as well. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://p.sf.net/sfu/creativitycat-com ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request for the amb operator
The following changes since commit 902b5adc4dcfb9cde52518203179623b21dabbff: Samuel Tardieu (1): Implement the amb(iguous) operator to ease backtracking are available in the git repository at: git://git.rfc1149.net/factor.git for-slava -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] The amb operator: backtracking made easy
I have just implemented the amb operator, as commonly found in Scheme. It is often called the angelic, or ambiguous operator. It allows to implement backtracking the easy way. It works by selecting the first item in the given list and returning it, then the second one when amb-fail is called, then the third one, and so on. When there are no more alternatives, it either goes up one level if calls to amb have been stacked, or signals an error if there are no more embedded amb calls. (scratchpad) { foo bar } amb --- Data stack: foo (scratchpad) amb-fail --- Data stack: bar (scratchpad) amb-fail amb: no more alternatives Let's assume we want to find an even value in a list. We will do this by calling amb-fail on other (non-even) items: (scratchpad) { 1 2 3 4 5 } amb dup odd? [ amb-fail ] unless --- Data stack: 2 Now, we are not pleased with this value, so we would like the next one satisfying this criteria: (scratchpad) amb-fail --- Data stack: 4 amb has saved the continuation and restarted from the same point with the next value in the list. Let's look for another one: (scratchpad) amb-fail amb: no more alternatives Calls to amb can be nested, as demonstrated thereafter. We are looking for all the couples (with one item in the first list and the other one in the second list) such as their product is 30: (scratchpad) { 1 2 3 4 5 6 } amb { 1 2 3 4 5 6 } amb 2dup * 30 = [ amb-fail ] unless --- Data stack: 5 6 (scratchpad) amb-fail --- Data stack: 6 5 (scratchpad) amb-fail amb: no more alternatives Also, the bag-of word takes a quotation and runs it as long as it returns result even when a failure is forced afterwards: (scratchpad) [ { 1 2 } amb { 1 10 } amb * ] bag-of --- Data stack: V{ 1 10 2 20 } The amb, amb-fail and bag-of words are located in extra/amb (as soon as Slava pulls it). Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] The amb operator: backtracking made easy
Sam == Samuel Tardieu s...@rfc1149.net writes: Sam I have just implemented the amb operator, as commonly found in Sam Scheme. [...] Sam The amb, amb-fail and bag-of words are located in extra/amb Sam (as soon as Slava pulls it). As noted by Slava, the extra/backtrack module provides this functionality already, in (IMO) a more convoluted way, and without tests and documentation. I will work on unifying both. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Planet Factor not offering links?
It looks like the feed of Planet Factor doesn't contain links to original articles. For example, look at http://inf355.wordpress.com/ where I import feeds for Planet Factor and Planet Scheme: only the latter offers links to the articles. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Nice ARM device, could run Factor
For whoever wants to attempt an ARM port ressurection, look at http://plugcomputer.org/ It looks nice, can run Linux, and is advertised at $99. -- Register Now Save for Velocity, the Web Performance Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Executable images
What about starting images with the string #! /usr/bin/env factor\n before any real data so that they can be made executable on Unix systems (they would run Factor with the image file as a parameter)? It could even be added to file(1) so that Factor images can be easily identified. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Register Now Save for Velocity, the Web Performance Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request
This patch makes q+ and q- available in math.quaternions, in order to increase their abstraction. Currently, the operations to use were v+ and v-, which revealed the underlying implementation. The following changes since commit 67fd98f42dbc5f1a6c6f5a8c41453436d2169cd9: Slava Pestov (1): Merge branch 'master' of git://factorcode.org/git/factor are available in the git repository at: git://git.rfc1149.net/factor for-slava Samuel Tardieu (1): Add q+ and q- to math.quaternions basis/math/quaternions/quaternions-docs.factor | 10 ++ basis/math/quaternions/quaternions-tests.factor |4 basis/math/quaternions/quaternions.factor |6 ++ 3 files changed, 20 insertions(+), 0 deletions(-) -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] FUEL gets confused by the : in HEX:
The stack effect computed by FUEL for 10 HEX: FF = is the one of =. I guess it gets confused by the : in HEX: and takes : FF as the declaration of the FF word. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: primes factoring optimization, and continued fractions
The following changes since commit 5aba91a0c57130e75628ec71510635f23780f1c5: Daniel Ehrenberg (1): Merge branch 'master' of git://factorcode.org/git/factor are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (2): When a factor has been found, check if the remainder is a prime number Continued fractions basis/math/primes/factors/factors-tests.factor |1 + basis/math/primes/factors/factors.factor | 25 +-- extra/math/continued-fractions/authors.txt |1 + .../continued-fractions-docs.factor| 14 +++ .../continued-fractions-tests.factor | 21 .../continued-fractions/continued-fractions.factor | 24 +++ extra/math/continued-fractions/summary.txt |1 + 7 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 extra/math/continued-fractions/authors.txt create mode 100644 extra/math/continued-fractions/continued-fractions-docs.factor create mode 100644 extra/math/continued-fractions/continued-fractions-tests.factor create mode 100644 extra/math/continued-fractions/continued-fractions.factor create mode 100644 extra/math/continued-fractions/summary.txt -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Semantic errors with specialized methods (GENERIC: and M:)
Ludovic == Ludovic Kuty mail...@kuty.be writes: Ludovic The word rectangle=area must declare a stack effect. But Ludovic the word declares a stack effect. Thus, I don't understand Ludovic what goes on. The *GENERIC* version must declare a stack effect: GENERIC: area ( shape -- x ) Ludovic PS: Is it a good practice to use pastebin with the mailing Ludovic list or pastebin is mainly for the IRC channel ? Maybe Ludovic message on the mailing list have to be self contained. For such short samples, including the information in the message makes it easier to answer for people who answer mail offline. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: math.text.french
The following changes since commit 6e9f0dbfdd8987741b56f4c26403e5852ec5a1c3: Slava Pestov (1): Update http.client docs for PUT request and stream post-data are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (2): Put 3digit-groups into its own vocabulary Implement math.text.french extra/math/text/english/english.factor |7 +-- extra/math/text/french/authors.txt |1 + extra/math/text/french/french-docs.factor |6 ++ extra/math/text/french/french-tests.factor | 22 ++ extra/math/text/french/french.factor | 97 extra/math/text/french/summary.txt |1 + extra/math/text/utils/authors.txt |1 + extra/math/text/utils/summary.txt |1 + extra/math/text/utils/utils-docs.factor|6 ++ extra/math/text/utils/utils-tests.factor |3 + extra/math/text/utils/utils.factor |7 ++ 11 files changed, 147 insertions(+), 5 deletions(-) create mode 100644 extra/math/text/french/authors.txt create mode 100644 extra/math/text/french/french-docs.factor create mode 100644 extra/math/text/french/french-tests.factor create mode 100644 extra/math/text/french/french.factor create mode 100644 extra/math/text/french/summary.txt create mode 100644 extra/math/text/utils/authors.txt create mode 100644 extra/math/text/utils/summary.txt create mode 100644 extra/math/text/utils/utils-docs.factor create mode 100644 extra/math/text/utils/utils-tests.factor create mode 100644 extra/math/text/utils/utils.factor -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Locals Usage
Glenn == V Glenn Tarcea gtar...@umich.edu writes: Glenn I really like how Factor allows either usage, even though it Glenn creates a tension between the two styles. I personally dislike Eduardo's style, as it leads to code which looks too complicated to me and I think that it encourages longer words. What I like a lot about concatenative languages is the ability to easily refactor parts of existing words into new, shorted words, without any rewriting, and I have the feeling that this is often lost when locals are in the game. But heck, Eduardo shares much more Factor code than I do, so I let the code talk and wouldn't allow myself to criticize his (very useful IMO) experiments, even if I would prefer the Factor standard library to be more in a stack-oriented style. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Bogus example in client help
(scratchpad) \ client help [...] Examples www.apple.com http inet utf8 client [...] ( scratchpad ) www.apple.com http inet utf8 client Type check error Object: http Object type: string Expected type: fixnum -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Bogus example in client help
Sam == Samuel Tardieu s...@rfc1149.net writes: Sam And with IPv6, even the host name is not automatically resolved: Another problem: the IPv6 address components (between colons) are stored in a byte array while they are 16 bits long. Fix is available from git://git.rfc1149.net/factor.git for-slava Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] FUEL, what is it?
Jon == Jon Kleiser jon.klei...@usit.uio.no writes: Jon I've noticed a lot of mails to this list that mentions FUEL Jon in the subject, and I saw there's a fuel folder inside extra, but Jon I've not been able to find a description of FUEL and what it Jon does. I'm curious ... ;-) Fuel is a full Factor development environment based on Emacs. It offers most of Factor UI features (such as the navigation within the documentation), and even some more advanced ones such as the ability to extract phrases from an existing word and to refactor them into their own word. For example, if you have a word such as : : compute ( x -- y ) 2 * 1 + ; and notice that you could use 2 * in another context, just select it, press a few keys, answer the word name? question with double and you will automatically get: : double ( object -- object ) 2 * ; : compute ( x -- y ) double 1 + ; Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] An alternative for foldable?
Sam == Samuel Tardieu s...@rfc1149.net writes: Sam What is the best way to initialize primes-under-million at Sam parsing time? One intermediate solution is to make it foldable despite its output being mutable. This is not worse semantically than what was done before when the list was hardcoded (it can be modified by one of its users). However, it also means that the primes list will be recomputed when parsing every word that uses primes-under-million. The following makes it be computed at parsing time, but I guess there is a cleaner alternative: USING: compiler.units math.primes namespaces ; IN: math.primes.list PRIVATE SYMBOL: (primes-under-million) [ 100 primes-upto (primes-under-million) set ] with-compilation-unit PRIVATE : primes-under-million ( -- seq ) (primes-under-million) get ; -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] An alternative for foldable?
Slava Make it a MEMO: word. Then the result will only be computed Slava once. Sam Done, you can pull from Sam git://git.rfc1149.net/factor.git for-slava Sam However, this will degrade performance for Sam benchmark.binary-search, as the list will be computed at the Sam first occurrence. Doug call it as a toplevel form and drop the result. Doug Fair enough. Pushed to the same place as well. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] math.primes reorganization
Bruce == Bruce Breeanna Rennie bren...@dcsi.net.au writes: Bruce Just a quick question are you using the real Sieve or the Bruce pretend Sieve see http://lambda-the-ultimate.org/node/3127 for Bruce details of this. It was interesting reading. It is the real sieve. Thanks for the article anyway, it was a very pleasant reading! Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] An alternative for foldable?
I find it frustrating that foldable cannot be used when the word you want to apply it to returns a mutable sequence, even if I understand why. What could we do to allow compile-time evaluation of words returning sequences for example? It would be nice to have words such as : sum-of-small-primes ( -- n ) 2 10 primes-between sum ; compute their content as compile time. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] An alternative for foldable?
Slava == Slava Pestov sl...@factorcode.org writes: Slava why not just define a word : sum-of-primes ( m n -- x ) Slava primes-between sum ; foldable Sure, but that was just an example. It would be great to be able to indicate that the list of primes between two numbers can be known at compile time if the bounds are. Sam -- Samuel Tardieu -- s...@rfc1149.net -- http://www.rfc1149.net/ -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: sigma change
While using count, I noticed that sigma stored the current subtotal on the stack, preventing the quotation to fully manipulate items on the stack. The following changes since commit 6cfb951d82cf35f632e3794a4c971250e2ccfcdd: Doug Coleman (1): Merge branch 'master' of git://factorcode.org/git/factor are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (2): Allow sigma and friends to use the stack Project Euler - problem 57 core/sequences/sequences.factor |2 +- extra/project-euler/057/057.factor | 43 ++ extra/project-euler/project-euler.factor | 14 +- 3 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 extra/project-euler/057/057.factor -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Pull request: bit arrays were not properly set or cleared
The following changes since commit 321919d210182f30d0ca63fc4cd67c137118f0f4: Eduardo Cavazos (1): easy-help: Add 'List:' are available in the git repository at: git://git.rfc1149.net/factor.git for-slava Samuel Tardieu (1): Properly set bits in large bit arrays basis/bit-arrays/bit-arrays-tests.factor |2 ++ basis/bit-arrays/bit-arrays.factor |2 +- 2 files changed, 3 insertions(+), 1 deletions(-) -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] [PATCH, was: Re: cleave, 2cleave, and spread] Use more combinators
--- I replaced uses of keep by bi in those two files. I cannot tell whether I prefer the one or the other, as using bi with quotations returning more than one value on the stack may seem strange, but I'm getting slowly used to it. Feel free to git am if you wish, this message should be in the right format. extra/math/primes/primes.factor|8 extra/project-euler/169/169.factor |2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/math/primes/primes.factor b/extra/math/primes/primes.factor index 685124e..1c14715 100644 --- a/extra/math/primes/primes.factor +++ b/extra/math/primes/primes.factor @@ -13,7 +13,7 @@ PRIVATE : next-prime ( n -- p ) dup 83 [ -primes-under-million [ [ = ] binsearch 1+ ] keep nth +primes-under-million [ [ = ] binsearch 1+ ] [ nth ] bi ] [ next-odd find-prime-miller-rabin ] if ; foldable @@ -37,7 +37,7 @@ PRIVATE { { [ dup 2 ] [ drop { } ] } { [ dup 103 ] - [ primes-under-million [ [ = ] binsearch 1+ 0 swap ] keep slice ] } + [ primes-under-million [ [ = ] binsearch 1+ 0 swap ] [ slice ] bi ] } { [ t ] [ primes-under-million 103 lprimes-from rot [ = ] curry lwhile listarray append ] } @@ -45,7 +45,7 @@ PRIVATE : primes-between ( low high -- seq ) primes-upto - r 1- next-prime r - [ [ = ] binsearch ] keep [ length ] keep slice ; foldable + [ 1- next-prime ] dip + [ [ = ] binsearch ] [ length ] [ slice ] tri ; foldable : coprime? ( a b -- ? ) gcd nip 1 = ; foldable diff --git a/extra/project-euler/169/169.factor b/extra/project-euler/169/169.factor index 61645bf..d699af3 100644 --- a/extra/project-euler/169/169.factor +++ b/extra/project-euler/169/169.factor @@ -30,7 +30,7 @@ MEMO: fn ( n -- x ) { { [ dup 2 ] [ drop 1 ] } { [ dup odd? ] [ 2/ fn ] } -{ [ t ][ 2/ [ fn ] keep 1- fn + ] } +{ [ t ][ 2/ [ fn ] [ 1- fn ] bi + ] } } cond ; : euler169 ( -- result ) -- 1.5.5.rc2.155.gb0a67 - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] [PATCH, was: Re: cleave, 2cleave, and spread] Use more combinators
Slava == Slava Pestov [EMAIL PROTECTED] writes: Slava Using bi with quotations that take 1 value from the stack Slava is not idiomatic. Yeah, that's my feeling too. You can get a partial cleanup from git://www.rfc1149.net/factor.git for-slava Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] fry
Slava == Slava Pestov [EMAIL PROTECTED] writes: Slava FWIW, fry is documented now. This is very neat! But I am surprised by the behaviour of _; I would have imagined that it would have skipped (and kept) the corresponding data on the stack at frying time, to keep the natural order. The existing { 10 20 30 } 1 '[ , _ / ] map example would then be written as 1 { 10 20 30 } '[ , _ / ] map which seems to me more consistent with the order of / arguments. Sam PS/ I have just needed this kind of construct 5 minutes ago when solving a project Euler problem, but an added swap makes it ok of course. I wanted to set several keys in a hash-table to the same value, and would have loved to keep the same order as set-at by writing: : set-group ( value keys hash -- ) '[ , _ , set-at ] each ; PPS/ The { 8 13 14 27 } [ even? ] 5 [ @ dup , ? ] map example needs a '[ in place of the last [. -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] iPhone
Slava == Slava Pestov [EMAIL PROTECTED] writes: Slava Unfortunately the iPhone SDK has some pretty ridiculous Slava restrictions -- you can only distribute your programs through Slava the Apple store, and you're not allowed to write programs that Slava can dynamically load and execute code. Doesn't it mean that the Factor VM needs to be distributed through the Apple store? How would they prevent the execution of code coming from the image? Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Factor on Nokia N95?
Out of curiosity, has anyone attempted to port Factor to the Nokia N95 (or the S60 series)? Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Standalone applications in Factor
Wouldn't it be great if Factor could generate standalone applications with only the minimum needed? (without the compiler for example, and without the interpreter if everything got compiled) (I know that Use the Source Luke is a great answer to this question, but I'm currently busy fixing long-lived bugs in GCC's Ada front-end at this time) Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] unit tests
Phil == Phil Dawes [EMAIL PROTECTED] writes: Phil [ { 2 3 3 5 6 7 } ulong-array ] Phil [ { 5 3 2 6 7 3 } ulong-array natural-sort ] unit-test I forgot 1array in my previous answer: { 2 3 3 5 6 7 } ulong-array 1array [ { 5 3 2 6 7 3 } ulong-array natural-sort ] unit-test - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Efficient way of adding a word in front of a quotation
Slava == Slava Pestov [EMAIL PROTECTED] writes: Slava What are you coding? Nothing particular yet, just playing. Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] RSS/XML error with Samuel Tardieu ’s atom feed
Slava == Slava Pestov [EMAIL PROTECTED] writes: Slava http://www.rfc1149.net/blog/feed/atom/; news-get Slava I'd love to add Sam's blog to the planet-factor blogroll but I Slava have to resolve this issue first. Note that you should only add the Factor related posts (http://www.rfc1149.net/blog/tag/factor/feed/atom/). Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Question about vm/primitives.h
In vm/primitives.h, I read: | We do the assignment of stack_chain-callstack_top in a ``noinline'' | function to inhibit assignment re-ordering. stack_chain being global, in which case could an assignment re-ordering occur? (the compiler doesn't know if it will be used in subsequent functions, so I think it *must* do the assignment at the right place) And even if the compiler has a valid reason to move the assignment around, wouldn't it be enough to make stack_chain-callstack_top volatile? Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Abusing curry?
I was in the need of a unique word which, given a sequence, builds a new sequence of the same kind with unique elements of the input sequence while keeping the same order (only subsequent duplicate elements must be ommited). I ended up with: : unique ( seq -- newseq ) [ dup length vector tuck dup [ member? not ] curry swap [ push-if ] curry curry each ] keep like ; Is that an abuse of curry (three of them?) How would you write it? Sam - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Factor Constants
Jeff == Jeff Ervin [EMAIL PROTECTED] writes: Jeff : data { { x 4 z } { 1 x z } { z x y } } ; Jeff is there any way to do this in Factor? In your particular example, you can do: : data [ x , 4 , z , 1 , x , z , z , x , y , ] { } make 3 group ; Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] ICFP Contest
Dan == Daniel Ehrenberg [EMAIL PROTECTED] writes: Dan Anyone interested in joining the ICFP Contest with me and ghm33? Dan If so, email me. So, how is it going so far? Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] [ann] mercurial mirror
Adam == Adam Wendt [EMAIL PROTECTED] writes: Adam Hmm I must be missing something, how can i 'hg pull' from this? Adam complains about no repository found. hg clone http://mercurial.creo.hu/repos/factor-hg/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Newbie questions, words and shuffling
bbrown == bbrown [EMAIL PROTECTED] writes: bbrown Hello, I am kind of embarrased for asking, but I am. And, bbrown others from the imperative/procedural world may ask the same bbrown questions. I am trying to convert some code to factor, but am bbrown having an issue with understanding how the stack works and how bbrown to manipulate and get values from it. Say, for example; how bbrown would you convert this java code to factor. I have an idea, bbrown but not 100%. You would not convert the code as-is. However, if you really want to do this, this could give something like: : myTestInit ( str -- newstr ) Testing: swap append ; : myTestWord ( seq -- str ) { Arg1 Arg2 Arg3 Arg4 } [ write : write print ] 2each myTestWord ; : myTestDriver ( seq -- str ) (null) myTestInit add* myTestWord drop myTestDriver ; : main ( -- ) { Two Three Four } myTestDriver drop ; Now, since the return values of myTestWord and myTestDriver are never used, you would rather do: : myTestInit ( str -- newstr ) Testing: swap append ; : myTestWord ( seq -- ) { Arg1 Arg2 Arg3 Arg4 } [ write : write print ] 2each ; : myTestDriver ( seq -- ) (null) myTestInit add* myTestWord ; : main ( -- ) { Two Three Four } myTestDriver ; or, to avoid repetition of Arg1 .. Arg4, : myTestInit ( str -- newstr ) Testing: swap append ; : arg ( n -- str ) Arg swap numberstring append : append ; : myTestWord ( seq -- ) 4 [ 1+ arg write print ] 2each ; : myTestDriver ( seq -- ) (null) myTestInit add* myTestWord ; : main ( -- ) { Two Three Four } myTestDriver ; Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] prune
Dan == Daniel Ehrenberg [EMAIL PROTECTED] writes: Dan This new prune is about 2.5 times faster when pruning the Dan sequence [ 100 [ 100 % ] times ] { } make , though it gives the Dan results in a different order. However, pruning a short sequence Dan like { 1 2 1 2 1 2 } appears to be around 1.5 times slower. You made me wonder what would happen with an hashtable to keep track of values that have already been considered. I've tried the following words: : set-hash-t ( hash elt -- ) t swap rot set-hash ; : push-new* ( seq hash elt -- seq ) dup pick hash [ 2drop ] [ tuck set-hash-t over push ] if ; : prune* ( seq -- newseq ) [ V{ } clone H{ } clone rot [ push-new* ] each-with ] keep like ; With your 10,000 elements list prune* is 10 times faster than prune, and with { 1 2 1 2 1 2 } it is still slightly better. The semantic difference between prune and prune* semantics is that prune keeps the last element in the sequence while prune* preserves the first one. Incidentally, I prefer the prune* variant. Sam PS/ Making set-hash-t inline or reducing stack shuffling around it should further increase the performances. For example, set-hash-t could be replaced by something like dup rot set-hash (to store the element itself as both the key and the value, since the value has no importance), or even by over set-hash (storing the hash-table itself as value) but I haven't looked at the garbage collector and I don't know whether circular references would confuse it. -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] x86 register usage
Sam == Samuel Tardieu [EMAIL PROTECTED] writes: Sam I have a few questions concerning execute() in vm/cpu-x86.[hS] I also have a question regarding native_stack_pointer(). Would not the following version (in cpu-x86.h) be cleaner and more efficient? INLINE void *native_stack_pointer(void) { register CELL esp asm(esp); return (void*)esp+4; } (the +4 makes it an equivalent of the previous version with the x86 ABI, as the 32 bits return value was pushed on the stack) Sam -- Samuel Tardieu -- [EMAIL PROTECTED] -- http://www.rfc1149.net/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk