rebol

Hacker News 简讯 2020-08-07

萝らか妹 提交于 2020-11-13 01:22:22
最后更新时间: 2020-08-07 23:01 On the Performance of User-Mode Threads and Coroutines - (inside.java) 关于用户模式线程和协程的性能 得分:30 | 评论:3 Mac keyboard shortcuts - (support.apple.com) Mac键盘快捷键 得分:153 | 评论:191 Crush: A command line shell that is also a powerful modern programming language - (github.com) Crush:一个命令行shell,也是一种强大的现代编程语言 得分:246 | 评论:89 CNO neutrinos from the Sun are finally detected - (syfy.com) 来自太阳的CNO中微子终于被探测到了 得分:82 | 评论:19 A T Cell Army against SARS-CoV-2 - (hellovirology.com) 抗击SARS-CoV-2的T细胞军队 得分:11 | 评论:0 Self-Contained Development Environments (2018) [pdf] - (charig.github.io) 独立开发环境

How to parse inside HTML tags with REBOL?

二次信任 提交于 2020-01-23 02:47:53
问题 I have a web page that I've loaded with load/markup. I need to parse a bunch of stuff out of it, but some of the data is in the tags. Any ideas of how I can parse it? Here's a sample of what I've got (and tried) so far: REBOL [] mess: { <td>Bob Sockaway</td> <td><a href=mailto:bsockaway@example.com>bsockaway@example.com</a></td> <td>9999</td> } rules: [ some [ ; The expression below /will/ work, but is useless because of specificity. ; <td> <a href=mailto:bsockaway@example.com> s: string! </a

Creating map function in Red language

笑着哭i 提交于 2020-01-17 08:37:09
问题 How can I create map, a higher order function, in Red language. It should take a block and a function as arguments and apply the sent function to each member of block. I tried following code: Red [] mapfn: function[blk sfn][ outblk: copy [] foreach i blk[ append outblk (sfn i) ] outblk ] ; to test: myblk: [" this " " is " " a " " line " "for" " testing " " only "] probe mapfn myblk 'reverse probe mapfn myblk 'trim But it is not working - it simply sends back the original block without

Parse and Break: why break cannot be used for getting out of “any” or “some” rule?

自作多情 提交于 2020-01-17 02:39:48
问题 Let say I have to parse a hierarchical set of tags <tag> <subtag1 attr1=value1 attr2=value2> <subtag1 attr1=value1 attr2=value2> <subtag1 attr1=value1 attr2=value2> </tag> Why can't I use break inside some or any to get out of a level hierarchy ? This would allow to do that kind of parsing instead of having a headache to do so ? I'm asking this because I read here http://www.codeconscious.com/rebol/parse-tutorial.html it would create an infinite loop This case produces an infinite loop.

Compile Rebol code to executable

旧时模样 提交于 2020-01-16 09:11:31
问题 I downloaded Rebol/View (vesion 2.7.8) Linux x86 libc6 2.3 version from http://www.rebol.com/downloads.html and it is working all right as an interpreter on Linux (Debian Stable 9). Is it possible to compile the code to executables? I tried checking the options, and compile to executable option does not seem to be there: $ rebol -v --help The command line usage is: REBOL <options> <script> <arguments> All fields are optional. Supported options are: --cgi (-c) Check for CGI input --do expr

Variable value in foreach of Red language

♀尐吖头ヾ 提交于 2020-01-15 06:27:05
问题 I am using following code to add multiple GUI elements to a view via a foreach loop: myRange: function [n][ ; to produce a vector of [1 2 3 4... n] vv: make vector! n i: 1 foreach j vv [ vv/:i: i i: i + 1 if i > n [break]] vv ] view collect[ foreach i myRange 10 [ print append "i in loop: " i keep [ t: text ] keep append "message number: " i keep [field "entry" button "Click" [t/text: "clicked"] return] ] ] All GUI elements are being produced. But the code append "message number: " i is

is it possible to have static variable inside a rebol function?

我们两清 提交于 2020-01-14 05:08:09
问题 This shows how to have a static variable inside an object or context: http://www.mail-archive.com/list@rebol.com/msg04764.html But the scope is too large for some needs, is it possible to have a static variable inside an object function ? 回答1: In Rebol 3, use a closure (or CLOS) rather than a function (or FUNC). In Rebol 2, fake it by having a block that contains your static values, eg : f: func [ /local sb ][ ;; define and initialise the static block sb: [] if 0 = length? sb [append sb 0] ;;

is it possible to have static variable inside a rebol function?

左心房为你撑大大i 提交于 2020-01-14 05:08:07
问题 This shows how to have a static variable inside an object or context: http://www.mail-archive.com/list@rebol.com/msg04764.html But the scope is too large for some needs, is it possible to have a static variable inside an object function ? 回答1: In Rebol 3, use a closure (or CLOS) rather than a function (or FUNC). In Rebol 2, fake it by having a block that contains your static values, eg : f: func [ /local sb ][ ;; define and initialise the static block sb: [] if 0 = length? sb [append sb 0] ;;

Why do function “have memory” in REBOL?

喜欢而已 提交于 2020-01-12 23:19:10
问题 In rebol I have written this very simple function: make-password: func[Length] [ chars: "QWERTYUIOPASDFGHJKLZXCVBNM1234567890" password: "" loop Length [append password (pick chars random Length)] password ] When I run this multiple times in a row things get really confusing: loop 5 [print make-password 5] Gives (for example) this output: TWTQW TWTQWWEWRT TWTQWWEWRTQWWTW TWTQWWEWRTQWWTWQTTQQ TWTQWWEWRTQWWTWQTTQQTRRTT It looks like the function memorised the past executions and stored the

How do you start a Rebol3 GUI script without the console showing?

邮差的信 提交于 2020-01-05 09:49:06
问题 Currently I start a GUI from the console which involves first loading the GUI with load-gui and then run the script which shows the GUI. How can I start the GUI without a console showing? 回答1: You have to specify the open/exe action for the R3 script : the R3 exe. 来源: https://stackoverflow.com/questions/24717336/how-do-you-start-a-rebol3-gui-script-without-the-console-showing