AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 5907 |
r3wp | 58701 |
total: | 64608 |
results window for this page: [start: 27701 end: 27800]
world-name: r3wp
Group: Core ... Discuss core issues [web-public] | ||
BrianH: 10-Apr-2006 | It has been aailable in versions of View that can be upgraded to View/Pro with a license, even when the Pro features are disabled by the lack of a license. However, the struct! type is implemented by the library extension, along with routine! and such. Can anyone confirm that struct! is available in versions of View that do not have the library extension at all, like View for Mac? | |
Vincent: 11-Apr-2006 | but not for /View 1.2.1 : no system:// port, and debase crashes sometimes. A little better than "load rejoin" : load join "#{" [to-hex value "}"] | |
Gabriele: 11-Apr-2006 | rebcode supports shifting; not sure if it makes sense to have a native too, maybe yes. | |
JeffM: 11-Apr-2006 | shifting is a very basic operation. I don't understand how it couldn't be part of the core, native functions. The same could be said of AND and OR, and just make them logical operators instead of bitwise. | |
JeffM: 12-Apr-2006 | I disagree, but that's fine. I imagine the majority of those using REBOL are using it for non-low level things. I just don't happen to be one of them. REBOL is a great language for making domain specific languages, and many DSLs would benefit from a little more low-level control. | |
Henrik: 12-Apr-2006 | I have to disagree as well. I've bumped into a few examples where bit-operations would be very nice to have, if you want to use REBOL for prototyping bit-operations in another environment. Afterall we can create bitsets, why not allow full manipulation of them? | |
Gregg: 12-Apr-2006 | Well, you can write your own; if just prototyping, the speed isn't critical (we did 160 bit math for Maarten, using bitsets, at one point). That said, if you can use a version with rebcode, just wrap a mezzanine around the ops. That said, I wouldn't mind having standard SHIFT and ROTATE funcs that can operate on integer, or series values. Bit ops are also necessary for implementing certain algorithms. | |
Gregg: 12-Apr-2006 | Here are prototype funcs for SHIFT and ROTATE (plus a couple supporting funcs). Is it worth some time to come up with good ones and submit them for inclusion in R3? | |
Gregg: 12-Apr-2006 | ; used in SHIFT below dup: func [value len [integer!] /local type] [ type: either series? value [value] [either char? value [""] [[]]] head insert/only/dup make type len value len ] ; used in SHIFT below make-blank-value: func [type] [ any [ attempt [make type 0] attempt [make type ""] attempt [make type []] attempt [make type none] ] ] ; The new PAD/JUSTIFY func might be used to implement this as well. shift: func [ "Shift values in a series; length doesn't change." series [series!] /left "Shift left (the default)" /right "Shift right" /part range [number!] "Shift this many positions" ; TBD series! support? /with fill "Fill vacated slots with this value" /local pad ][ range: any [range 1] if any [empty? series 0 = range] [return series] pad: dup any [fill make-blank-value last series] range either right [ head insert head clear skip tail series negate range pad ][ append remove/part series range pad ] ] rotate: func [ "Rotate values in a series." series [series!] /left "Rotate left (the default)" /right "Rotate right" /part range [number!] "Rotate this many positions" ; TBD series! support? /local offset pad ][ range: any [all [range range // length? series] 1] if any [empty? series zero? range] [return series] either right [ offset: does [skip tail series negate range] pad: copy offset head insert head clear offset pad ][ pad: copy/part series range append remove/part series range pad ] ] | |
Anton: 12-Apr-2006 | I am trying right now to write a file to an FTP server. What I would like to do is: - open the port - try to write the file - if that fails, create the parent directory if necessary - try to write the file again - close the port | |
Anton: 16-Apr-2006 | Ah... figured out how to do that :) The solution is to disable close-on-fail in the handler, so that a failure in open does not close the ports. This allows the command port to be reused for other commands, such as make-dir. | |
Graham: 16-Apr-2006 | Gregg says write %//prn .. I'll give that a go. | |
JeffM: 18-Apr-2006 | Like bit shifting. I do appreciate Gregg's functions. However, when something that boils down to a single instruction in hardware requires 6 lines of code and multiple function calls, something is wrong. ;) | |
Graham: 18-Apr-2006 | Hmm. Does 'send have a forward option? | |
Ingo: 19-Apr-2006 | Do you mean like this? >> b: "(blue)" == "(blue)" >> compose bind to block! b 'white == [0.0.255] You just have to give any word from the same context to bind ... so inthis case any word from the global context (i.e. system/words). The only point to be aware of: If all this happens in a different context, and you happen to have a word named 'white in this context, then you have to use another word. | |
Graham: 19-Apr-2006 | Anyone written a fetchmail in Rebol? | |
Gabriele: 19-Apr-2006 | does send have a forward option - maybe you are looking at RESEND | |
Graham: 19-Apr-2006 | ahh.. a new function :) | |
Henrik: 19-Apr-2006 | this is probably outside of core and more at the OS level, but it would be nice to somehow check if a script is already running via LAUNCH, to make sure it's only launched one instance at a time. Is this possible? | |
Anton: 19-Apr-2006 | maybe try to launch a dummy script and catch the error. | |
Henrik: 19-Apr-2006 | another thing could be to have a masterscript running and let the other scripts report to it via LNS, but that's not very elegant... | |
Gregg: 19-Apr-2006 | You could use a semaphore of some kind (port/file). | |
Henrik: 19-Apr-2006 | a script can't launch itself? | |
Anton: 19-Apr-2006 | A launched script cannot launch further scripts. | |
Henrik: 19-Apr-2006 | what if I have a menu system which launches subscripts A, B, C, D and E. I launch A and C. Then the menu crashes or is accidentally quit. I launch the menu system again, but then it should know the state of the running programs. | |
Ingo: 19-Apr-2006 | re. fetchmail ... What exactly are you looking for? fetchmail in its current incarnation fetches mail via pop3, and sends it via smtp to a local mta ... shouldn't be too hard. | |
Graham: 19-Apr-2006 | I am wondering whether I should install fetchmail, or just use/write a rebol version. | |
sqlab: 19-Apr-2006 | Henrik: you can either assign every script an unique port number and try to open it at startup or (under window) give the console window a name and check if a window with that name already exists or (under **ix) check the command line with ps | |
Graham: 19-Apr-2006 | That is what I do .. my scripts up a listen port, and if they can't, they know an instance is already up and running. | |
Ingo: 19-Apr-2006 | Well, I once did a script that just downloads and stores mails locally, but none that works like fetchmail ... on linux I have fetchmail installed, and on win I don't have an mta ;-) | |
Geomol: 20-Apr-2006 | Bit-shifting One way to do bit-shifting is to multiply or divide with (2 ** positions). To make the code more readable, I could start making a shift block: shift: [] repeat i 16 [append shift to-integer 2 ** i] == [2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536] To e.g. shift the number 123 left 5 positions, you do: 123 * shift/5 == 3936 To check, that 3936 is actually 123 shifted left 5 positions: >> enbase/base debase/base to-hex 123 16 2 == "00000000000000000000000001111011" >> enbase/base debase/base to-hex 3936 16 2 == "00000000000000000000111101100000" To shift 3936 right 5 positions: 3936 / shift/5 == 123 As long as the numbers are not close to 4 byte long integer (2 ** 32), we don't get number overflow. | |
eFishAnt: 24-Apr-2006 | HELP (please) I have installed Core 2.6 on an embedded Ubuntu Linux, and when I try to open the comm port, I get and Access Error for ttyC0 but when I look in the /dev/ directory, I see a ttyc0 but not a ttyC0 ... I tried as root to ln -s /dev/ttyc0 ttyC0 ... but get the same error. | |
eFishAnt: 24-Apr-2006 | I do a serial-port: open/direct/binary/no-wait serial://port/38400/8/none/1 serial://port1/38400/8/none/1 | |
Graham: 24-Apr-2006 | Anyone got a way of operating on each element of a series except the last ? | |
Geomol: 24-Apr-2006 | eFishAnt, a wild guess: what about rebooting the OS after you've made the link to ttyc0? Maybe some internal list of devices is made, when the OS boots? | |
Graham: 24-Apr-2006 | Thanks .. I was using a while block, but yours is shorter. | |
Anton: 24-Apr-2006 | eFishAnt, you have replaced the block at system/ports/serial. Try replacing just the first word in the original block with 'ttyc0. Just a wild guess. | |
Maxim: 25-Apr-2006 | I've discovered that the GC seems to accelerate as it processes more and more of the same data... A 10 million allocated, linked and initalised liquid node test is proving this once more, so my guess is that Carl put some kind of heuristic detection or what have not, which adapts the sizes of the values in the allocation and GC, based on recurring tasks. | |
Maxim: 25-Apr-2006 | I manually call a recycle at the end of each iteration. so 300MB is what is needed to have 100000 nodes in memory without any GC. | |
Maxim: 25-Apr-2006 | imagine a double edged directed graph node. | |
Anton: 25-Apr-2006 | It must use part of the View system in order to show something in a window (faces) and to get events. | |
Maxim: 25-Apr-2006 | glass is a compositing engine, which might grow out of view IF R3 promises are fullfiled. | |
eFishAnt: 25-Apr-2006 | I was going to ask what is a good hex editor to download into ubunto...but then I figured out I should just use a REBOL hex editor...if I need to to change I can just change it myself. | |
Anton: 25-Apr-2006 | Thanks. :) I had to contort my forehead for a few days to get that to work. | |
Maxim: 25-Apr-2006 | Am I the only one who thinks that 64bytes for an empty block is a lot or ram? | |
eFishAnt: 25-Apr-2006 | seems like an empty block should only take 2 bytes...but then that is just the ASCII representation...binaries are bigger than their source code...I would expect some list links pointing, some datatype info...dunno. Maybe try a small program like REBOL[] probe empty: [] and inspect the RAM of it. | |
eFishAnt: 25-Apr-2006 | would be a good extension of a hex-editor...to just load a memory address and peek around and look at things...have REBOL inspect itself. | |
eFishAnt: 25-Apr-2006 | I don't have a Lauterbach debugger for x86 ... only for ARM, PPC, XSCALE, and some other MCUs...or that WOULD be cool. | |
Maxim: 25-Apr-2006 | I think I will have to design a cluster engine for liquid quite rapidly for some of my projects. | |
eFishAnt: 25-Apr-2006 | for very structured data, when space is a premium, and if it is packed tight, you could always do it through a dynamic linked library. | |
Maxim: 25-Apr-2006 | yeah, I intend to recode code liquid as a c module eventually, and probably use that natively in python and make a dll for it in rebol. | |
Maxim: 25-Apr-2006 | maybe a little bit more for linkeage data. | |
eFishAnt: 25-Apr-2006 | (also, you might find ways to structure your data in REBOL which reduce the number of block...like make them into structured objects ... just a wild guess, maybe that would compact it more?) | |
Maxim: 25-Apr-2006 | and can still allocate 20000 nodes a second on my trusty 1.5GHz laptop. | |
eFishAnt: 25-Apr-2006 | but it seems it would be a speed - size tradeoff. | |
Maxim: 25-Apr-2006 | each cell is a store of associations this cell has with other things in the db. being bi-directional nodes, I can create sets or groups of nodes and nodes can backtrack them to query related informations. | |
Maxim: 25-Apr-2006 | well, limited by 64 bits of addressing at a time. | |
Maxim: 25-Apr-2006 | (thats if R3 has a 64bit mode) | |
Maxim: 25-Apr-2006 | is anyone aware that inserting at the head of a block is EXTREMELY slow ? | |
BrianH: 25-Apr-2006 | Blocks are allocated in larger chunks that a single cell. That means that appends are usually just writes to a preallocated memory chunk. | |
Maxim: 25-Apr-2006 | ok makes sense now. still, I was surprise that preallocating a block of 1 million items was not that much quicker than starting with an empty block. | |
BrianH: 25-Apr-2006 | No point to preallocating a list! though, unless it is to make sure you will have enough ram :) | |
Maxim: 25-Apr-2006 | just for the record, I tried using lists, but in this stress test, they were quite memory intensive (compared to blocks) and eventually, the GC got slower at a rate quicker than the speed improvement I did notice in the begining. sooo as always, speed vs flexibility vs RAM still applies as always. | |
BrianH: 25-Apr-2006 | Well, the links in the list! type are overhead, and the chunks of memory taken up by list nodes are smaller than those taken up by blocks, leading to greater memory fragmentation. REBOL doesn't have a compacting collector. | |
BrianH: 25-Apr-2006 | On the other hand, list nodes are allocated one at a time rather than in groups, so if you have a lot of small lists they may take less ram than a lot of small blocks. I don't know how many cells are allocated when the runtime (re)allocates a block - I think it is powers of two up to multiples of 128. | |
BrianH: 25-Apr-2006 | No, that's the element size that causes that. Each block element has to hold a 64bit value (of various types) plus some typing overhead. Plus I would bet that every block has a one element prefix to store the block lengths. Plus, there is the overhead of your reference to the block which would be a value in another block. | |
Maxim: 25-Apr-2006 | right... I'm a bit tired ;-) | |
BrianH: 25-Apr-2006 | What I was talking about earlier was the allocation quanta. Blocks are allocated with the assumption that you will want to insert stuff into them without having to reallocate them every time. So by that powers of two to multiples of 128, when you want a block length 10, you get 16. When you want 129, you get 256, and so on. On that note, when you want 1000000, you would get 1000064. | |
BrianH: 25-Apr-2006 | A list may be twice as big, but if you want memory predictability you can't beat it because the allocation quanta is 1 node and the insert/delete is O(1). Indexing and length calculations are O(n) though. | |
Henrik: 26-Apr-2006 | wouldn't it make sense for SKIP to support hex values? I'm trying to locate a specific position in a binary and it's tedious having to convert to number! every time. | |
Gregg: 26-Apr-2006 | What is a hex value in REBOL? | |
Henrik: 26-Apr-2006 | volker, a specific location in the binary taken from a hex editor | |
Volker: 26-Apr-2006 | but that conversion could be put in a little function by yourself? | |
Gregg: 26-Apr-2006 | But what is the proper representation of a hex value in REBOL? An issue? An ENBASEd string? | |
Volker: 26-Apr-2006 | why not write a converter and then skip bin &h #c4d9 | |
Gregg: 26-Apr-2006 | Ah, but an issue is really a string, not a number. The TO-HEX function makes it look like this is the recommended approach (it's what I would say, too), but I think it's a type mismatch (unfortunately). | |
Gregg: 26-Apr-2006 | Here's what I use: hex: func [ {Returns the base-10 value of a hexadecimal number.} value [integer! string! issue!] "A hexadecimal number" ][ ; Convert to an issue first, so integers can also be translated. to integer! to issue! value ] | |
Gregg: 26-Apr-2006 | When I first started in REBOL, I also aliased it as &H (as a func name), since that's the hex notation prefix in BASIC and can be used as a func name, unlike "0x" | |
Gregg: 26-Apr-2006 | It is a little extra work to use a func to convert values, but not awful. If you need to use it heavily in a particular app, I'd consider using a dialect. | |
Gregg: 26-Apr-2006 | You bet. Outline the domain and we can cook up a killer dialect. | |
Gregg: 26-Apr-2006 | i.e. why would a refinement be better than using PARSEs ANY keyword? | |
Gregg: 26-Apr-2006 | I think that might be confusing, because ANY in a parse rule implies optionality. | |
Gregg: 26-Apr-2006 | How about just using a PARSE-ANY wrapper mezz of your own? | |
Volker: 26-Apr-2006 | Ugly. parse/any looks nicer. And its a bit slower? But does the job. | |
Gregg: 26-Apr-2006 | Well, post it as a wish then. I haven't needed it, and I'm concerned that the dual meaning of ANY in the context of PARSE might be confusing, but Carl has the final say. | |
Jerry: 27-Apr-2006 | Most scripting languages (like Ruby) and even some programming languages (like Java) support the string-concatenation operator "+". >> "a" + "b" == "ab" I know that we can use the JOIN function, but a + operator for string would be nice too. Why doesn't REBOL do so? | |
Anton: 28-Apr-2006 | >> "a" + 2 + "b" ** Script Error: Cannot use add on string! value ** Near: "a" + 2 + "b" >> rejoin ["a" 2 "b"] == "a2b" What could be more elegant ? | |
eFishAnt: 28-Apr-2006 | If I knew nothing if programming languages, I would think "a" + "b" = "c" ;-) | |
Pekr: 28-Apr-2006 | when I first met programming language - basic on 8 bit home computer, I could not get how A = A + 1 can be valid :-) | |
Maxim: 28-Apr-2006 | you might want to count how many there are first? if only a few, maybe replacing one at a time will end up working? | |
JaimeVargas: 28-Apr-2006 | I think there is a way to specify your serial ports. I don't remember how. I but I have done it the past. I should search my files. | |
Gregg: 28-Apr-2006 | Hi Jerry, "I know that we can use the JOIN function, but a + operator for string would be nice too. Why doesn't REBOL do so?" Do you think it would be nice because it's more readable, or because it's familiar to people coming from languages that have it? I came to REBOL with a long BASIC history, and it didn't take me long before I didn't miss + for concatenation at all. + is really a math op; I like REBOL's consistency, and I like the way REBOL concat code reads. | |
Robert: 30-Apr-2006 | Hi, I need some help with BIND (I think that's what I need to use): I have a storage context, that has a bunch of function to handle the storage of other contexts. That those storage functions can work, they need to have access to the other context. I could do: storage/save-record context-to-save ... | |
Robert: 30-Apr-2006 | Example: context A [a: 1 b: 2 c:3 list-words: none] context storage [list-words: does [probe first self]] | |
Robert: 30-Apr-2006 | How can I execute storage/list-words in the context of A? So that I get back [a b c list-words] | |
Anton: 30-Apr-2006 | >> c1: context [a: b: none] >> c2: context [a: b: none] >> do bind [a: 1 b: 2] c1 == 2 >> probe c1 make object! [ a: 1 b: 2 ] >> do bind [a: 100 b: 200] c2 == 200 >> probe c2 make object! [ a: 100 b: 200 ] | |
Anton: 30-Apr-2006 | Oh sorry, you specifically want to bind a function's body to the context. Let's see, I think this will work: bind second get in storage 'list-words A storage/list-words | |
Anton: 30-Apr-2006 | >> A: context [a: 1 b: 2 c: 3] >> storage: context [list-words: does [probe first self]] >> storage/list-words [self list-words] == [self list-words] >> bind second get in storage 'list-words A == [probe first self] >> storage/list-words [self a b c] == [self a b c] | |
Anton: 30-Apr-2006 | read as: "bind the body of list-words to A" | |
Anton: 30-Apr-2006 | Yes, bind needs a block! value, not a function! |
27701 / 64608 | 1 | 2 | 3 | 4 | 5 | ... | 276 | 277 | [278] | 279 | 280 | ... | 643 | 644 | 645 | 646 | 647 |