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: 19201 end: 19300]
world-name: r3wp
Group: I'm new ... Ask any question, and a helpful person will try to answer. [web-public] | ||
Pekr: 31-May-2007 | For things that do exist: Resources: - http://www.rebol.com- corporate site, you will find docs linked there - http://www.rebol.net- developer's central. Sadly site was much more rich, but there was a server crash some time ago. But - still valuable rources - test releases, Carl's blogs, RAMBO bug database etc. | |
RayA: 31-May-2007 | Thank you for the links! I briefly saw some of the information, but not being a guru, I'm really looking for the "idiot's guide to REBOL" that gently introduces the reader to the power of REBOL through simple examples so I/others can "think deifferently" about programming and undo all the years of bad habits from other languages. | |
Pekr: 31-May-2007 | mostly a spare time, but look at Carl's presentation - he sumes it up there too. There are few developers, doing REBOL full time: - few top developers present here work for RT on contractual basis. - there is a company called SafeWorlds (Reichart's company) - he employs tens of ppl IIRC. Their new system is http://qtask.com, front end is web 2.0, but whole back-end is REBOL based. - few developers working on their own - Henrik, Ashley, DocKimbel (mySQL, postgress cool protocols, Uniserve, Cheyenne) | |
RayA: 31-May-2007 | I've "meet" Ashley, a very helpful Aussie who sang the praises of REBOL and got me conected to the Rebol3 world! So a big thanks to Ashley. | |
RayA: 31-May-2007 | It seems that the the time might be right to develop a "killer" application that leverages the power of REBOL3 ;-) | |
RayA: 31-May-2007 | Well actually I do, and the customers are ready for a major change, but the "killer" application must be scalable, fault tolerant, manageable, support hot code swapping, and by priced right. | |
Pekr: 31-May-2007 | what kind of app are you about to build? Will you use also REBOL gui? Or a web front end? | |
RayA: 31-May-2007 | I believe in Carl's vision "REBOL is perfect for lightweight distributed applications". Users need light-weight responsive gui clients that can work both online and offline. The evolution of the Web is moving (slowly) in this direction, with AJAX/Flash/JavaFX as examples of a more responsive and rich gui clients, BUT it's too complex and unreliable. The industry is adding kludge upon kludge to "fix" the problems resulting in further complexity and code bloat, but what is needed is a clean approach that captures the essence of what made the web a phenomal success in the first place - any body could set up/develop a web site and they did. Enterprise data centers need scalable, reliable, manageable (server) applications that run 24x7 on commodity hardware ata reasonable price. The user PC's should require zero management for the applications, which is the primary (only?) attraction of the web ui. Question if the application is simple to manage and delivers the functionality the user wants, why do they need a fat complex os? As an example my kids get online to play games, research homework, etc. and they hate it (so do I) when the PC/OS gets in the way. Also, that PC/OS is a major source of trouble with viruses and lack of (simple) control to what my kids can access. | |
RayA: 31-May-2007 | IMHO, I don't believe hese companies are capable of developing a clean solution, in fact it may not be in their best interest. | |
DaveC: 31-May-2007 | Hi RayA and Welcome. I am a new to AltMe too. I think you are right about the evolution of the web. The Desktop OS has become an application in itself (IMHO). It's the focus of so much angst, controversy and complication. (Nailing my personal colours to post here: I declare myself a BSD UNIX type. I can still install the latest version in much less than 100MB of HD space and 32MB ram and 100Mhz CPU. In fact I run it on an old Toshiba laptop with that spec and get real work done) I think, in principle, DOS was my idea of a good OS (I know, I know...) It was small, fast a stable. Yes - lockups were common when pushed, but I found it was the application that crashed rather than DOS itself. Ok. back in the world of the 21st Century, an OS need many many times the resources of DOS just to get itself booted. But basically, all I want from the OS is to let the applications get on with the job in hand. What attracts me to Rebol is that it is clean and lightweight. Designed by a man who I respect as a Computer Scientist. (And, of course, the Rebol community, which collectively one might say is a "killer app" too). It's very productive and I'm building internal information systems with it. I've got a few ideas to build my own apps outside of work, that is an exciting prospect for the future. I keep trying other frameworks/languges and over the last six years or so I've lost the "Rebol way" and strayed from the one true path! I do find myself coming back to Rebol as I run into more library conflict/dependency/blot features of some of the other languages I used. Maybe I'm getting impatient of complicated technology now I'm older. I just get tired of having to search the internet for the latest whatever.so.1 lib, or what have you. I'm making a general point here BTW - I know there are some very good language implimentations out there. I don't know what the next killer app will be, but I do think there is a place for a machine "Powered by REBOL" which boots in a few seconds, lets me communicate, write view images, multimedia, code my own Rebol apps from a set of built in services, oh and the battery lasts for days - not hours! It would have to display HTML too (legacy web :-)) So there you go, a bit of a rant from an old geezer technologist . Now where's me 8" floppies I need to boot that PDP-11? | |
Gregg: 31-May-2007 | Does REBOL provide architecture documentation/guidelines and/or frameworks for the development of scalable, fault tolerant, manageable, with hot code swapping for soft real-time 24x7 applications? Petr already covered the basics (Thanks for doing that Petr!), so I'll just chime in with opinions. I've been using REBOL since 2001. No tool is perfect, and REBOL is no exception, but there are only a few things I think it really isn't suited for even in its current form. It was not designed for programming in the large, but that's a benefit as much as a drawback, until you start building larger systems. IME, REBOL does require a different mindset if you want to get the most out of it. You can write code as you would in many other languages, but you won't see the big benefits REBOL offers if you do. It's still a good tool, even used that way. The docs and tools you asked about don't exist in official form, but there are a lot of "pieces" in the community. I'm working on something now that has those same goals. | |
DaveC: 31-May-2007 | Rebol does require a different mindset if you want to get the most out of it It's what I call the Zen of Rebol. I think it explains why it's taken me years to really "get it". I'm still learning of course. In a way, I wish I'd not had a backgound in procedural languages before Rebol. | |
Henrik: 31-May-2007 | I find myself changing the mindset with REBOL every few years, because for a long time I was afraid of for example, using PARSE. PARSE is so central and important that it can change the way you work with REBOL, if you have stayed away from it. I had the same experience when starting to use the SDK and when starting to do networking stuff in REBOL to let scripts communicate with eachother. It's not just a new set of ideas that turn up that lets me add to existing scripts, but doing the same scripts in entirely different ways. I feel I know about 30-40% of REBOL. :-) It's so damn deep. | |
DaveC: 31-May-2007 | Yes, I can only swim so deep before I run out of air :-) I read a snippet of code related to the system object and think, Wow! I didn't even know that existed. As you say, Parse itself is such a powerful thing. What I find inspirational is to sit down in front of the console and just explore ideas. | |
Geomol: 31-May-2007 | REBOL is like a little, magic and very deep lake high up in the mountains. It doesn't look much on the surface, but you'll be surprised, again and again. It's a good exercise (maybe not for the totally newbie) to read some of the scripts, Carl has produced. They can be found e.g. in the Library. You find things like this one, that I trampled over in his color-code.r script: set [value new] load/next str load/next ... !!?? cute! :-) | |
RayA: 31-May-2007 | Thanks everyone for your prompt and honest comments. Why did I join this community? The primary reason is to be part of a small, smart and passionate group who think differently, which when combined with REBOL is a very powerful combination. Therefore it would seem that focusing the resources of the community on a "killer" application leveraging REBOL3 would increase the chance of REBOL becoming main stream, and as a side effect possibly allow part time REBOL developers to become full time REBOL developers. As an example, think what Ruby on Rails did for Ruby. Wouldn't it be nice to get paid to do what you love! IMO/E I believe it's very important for the application vendors to have very close and strong ties with the platform vendor so architectures and features can be designed and exist at the correct layer. Also, if something needs to be implemented in the application but really belongs in the platform, it can be done in a way that enables that feature to be migrated in the future with minimal impact and extra work. This seems to fit with REBOL's history of improving based on experience. I'd like to think it's possible to build great applications in 3 months, with new releases every three months as required based on requirements, so I don't have the time (and maybe not even the ability) to spend years learning REBOL. I'd also argue that for a company to be successful, it needs a small team to have a number of diverse skills which is focused on delivering the product. I mentioned when I first signed on that I would be interested to meet REBOL gurus who are in Northern California and see what happens when interesting (or not) people get together. Sorry for the length of this post and thanks for listening. | |
Henrik: 31-May-2007 | About dialects: You may not know what it is, so I'll give a brief real example of what I did, when adding a dialect to my database system. It does 3 different database operations, the details don't matter, but here goes: lock-state: db/release locker-id current-object set [lock-state current-object] db/add-object locker-id if all ['locked-by-me = lock-state object? current-object] [ current-object: db/advance locker-id current-object ] This is RPC based, which means I call specific functions in the database over the network, pass parameters, get stuff back in return and maintain database environment variables. This is how you do it traditionally. Now with a dialect, you can say something like this: do-database [release add advance] As you can see, it's an incredible code reduction. Same 3 operations. A part of it is of course that database environment variables are maintained internally and are not really a part of the dialect, which further reduces code. But I consider it a side effect of dialecting and makes it easier to design a uniform way of talking to the database. Now which method would you expose to a third party developer? :-) | |
Gregg: 31-May-2007 | Why did I join this community? The primary reason is to be part of a small, smart and passionate group who think differently, -- Then you're in the right place. :-) I love this community; it reminds me of the old MSBASIC forums on CompuServe, before the rise of VB. I'm in Southwest Idaho, but have a good friend in the Bay area who thinks REBOL is cool, though he doesn't use it (yet). And, yes, there are some dark corners in REBOL, and things I'd like to see change. It's hard to complain, though, because *almost* everything I'd like to change I *could* change if I really wanted to. | |
Gregg: 31-May-2007 | An important aspect of dialects, for me, is that they *don't* look like a series of function calls; there is often "implied state" which I think is powerful, but messes you up if you think in terms of functional programming. | |
RayA: 3-Jun-2007 | Since REBOL requires a programmer to "think differently", in general what type of person, skill set, and/or background is required for a person to be a good REBOL programmer? | |
Henrik: 3-Jun-2007 | you must accept that it does certain things differently, because there is usually a reason to why it does things differently. Some people won't accept this, and they won't figure out the true strengths of REBOL and go back to other languages. | |
btiffin: 3-Jun-2007 | RayA; I'm of two minds on this one. I'm attempting to show construction site bosses how to be 'good' REBOL programmers. Very simple, data driven code sequences. If you want to be a 'good REBOL' programmer, hang out here and watch for posts from the likes of Anton, Henrik, Gregg, Ashley, well...most of the players here. But a 'good' REBOL programmer can be anyone, in my humble opinion. | |
RayA: 3-Jun-2007 | Thanks for the feedback. I'm not the "best" programmer (hopefully I have other strengths ;-) ), but I'm looking for different and better ways to solve problems and build applications. Therefore, would a programmer with a computer science background with NON procedural languages like Lisp or ML be more likely to "grok" and appreciate REBOL? Would it make sense to "hire" a young/new programmer out of college and get them involved with REBOL early so they have less "bad habits" to unlearn? Are any schools teaching their students REBOL? I appreciate the help and opinions of the group. | |
btiffin: 3-Jun-2007 | I'll pipe up again and say anybody. Now, if you wanted to hire someone that could write say, a new LIST-VIEW or a dataflow engine, then there may be screening required. But if you wanted usable applications, I think the sole requirement may be 'willingness'. | |
RayA: 3-Jun-2007 | Therefore is a persons prior background unimportant, and it's just more important that they are "open minded" and willing to try something very different and not mainstream, or dare I say it, be a risk taker? Also, don't some languages (and the teaching of them) encourage more open minded thinking? For example, ime, it's nearly impossible to get Java programmers to think outside their language and OO only mindset. So what attracted everyone on this newsgroup to REBOL? And, in general, what type of applications are people trying to build? | |
btiffin: 3-Jun-2007 | RayA; You pretty much said what I was going to pipe up with again. REBOL encourages thinking outside the box. So a good 'good REBOL' programmer is perhaps a little more rare, but anyone with a desire to simplify life is 'in'. My first commercial app was in support of a volunteer fire department, the current work is going to be 'the next big internet thing'...in a small town for a small town. :) | |
Geomol: 3-Jun-2007 | I think, it is a plus to know functional programming. And if the programmer is used to do more than one thing in each line/statement, that will help also, when learning REBOL. Things like: insert back tail serie somefunc + 1 is often seen in REBOL. Experience with scripting languages is probably also a plus. I too had a background on the Amiga, staring in 1987 with an A500. In the 90'ies I started to explore the operating system more closely, and then it was natural to check out, what Carl was up to. Prior to REBOL, I've programmed in many languages incl. C, C++, 6502 ASM, PASCAL, COBOL, LOGO and sh and csh scripting. I develop many different things with REBOL from graphical applications, games and astronomical applications to tools, languages, databases, xml-stuff, word processor, etc. It's very few things, I would choose another language than REBOL to do. | |
DanielSz: 3-Jun-2007 | The more coding paradigms you know, the better it is. Rebol is great, but doesn't preclude you from investing tile in other languages. Rebol is one of the highest level language you will find, with maximum expressiveness. But learning Lisp is a whole experience, and OO coding is kind of vital these days as well (for GUI stuff, for example). Anyway, I got to Rebol because Carl sold it very well to my ears. I was a Rexx scripter, coding also in javascript, actionscript, and lua. Lua is great, as well. Compares well in some respect to Rebol. Good luck. | |
Geomol: 3-Jun-2007 | I remember, I found it hard at first to read and understand REBOL, but after some time I got it. My example above is maybe a good example. It is evaluated like: insert (back (tail serie)) (somefunc + 1) So 'insert' take 2 arguments, 1. and 2. outermost parenthesis. 'back' take 1 argument, so does 'tail'. 'serie' is a variable. 'somefunc' is a function taking no arguments. '+' is an operator connecting 'somefunc' and '1'. If a programmer can think this way easily, REBOL should be no problem. | |
BrianH: 3-Jun-2007 | I first got into REBOL on a complete whim - back then I used to learn and make new programming languages for fun. If you want to understand PARSE, it helps to have some background in parser generators, particularly recursive decent ones like Coco or Antlr. You can do more with PARSE, but the basic way you structure parse rules follows the LL model. Knowing regular expressions will not help. | |
[unknown: 9]: 3-Jun-2007 | Perhaps a great question to ask is not what is the best language, but rather, but what feels the best to program in. | |
Henrik: 3-Jun-2007 | I hang on, because of the enormous potential in it. Something like Rebcode and how it's implemented shows that. If Python or Ruby were a hand grenade, REBOL would be a nuclear bomb. :-) Not that direct comparisons are appropriate. | |
Sunanda: 3-Jun-2007 | Forgot, I used to write a lot of mainframe Rexx -- it sort of primes you for REBOL. REBOL is so elegant; but it is more than a toy language designed for elegance....It can lift heavy weights too. | |
Maarten: 3-Jun-2007 | Lisp let's you think thoughts previously not thought possible. REBOL makes you use them. In a way it may wreck a programmers view of the world because a lot of other technologies may become.... annoying | |
DanielSz: 3-Jun-2007 | Rebol may become your most useful asset in your toolbox, because it's expressiveness and its ease of use, but it will not help you understand computer science, precisely because it is so intuitive. Anyone trying to grasp the fundamentals of programming will have to delve in other languages and paradigms. Also, Rebol didn't spring from the void. It is grounded in what Carl knows and he knows a lot. I think the link with Lisp is obvious. Parsing comes from the BNF grammar. I greatly benefited from studying S-expressions. Look at how Lua implements associative arrays (tables), it is very instructive, very powerful, they are better than hashes in Rebol, (Carl has expressed interest in his blog to revise them). Another thing Lua got right is size, it is smaller than Rebol. Lua can be ported more easily, it is available on the palm platform for years now. Rebol still promises this. Learn Rebol, but don't stop with Rebol. | |
DanielSz: 3-Jun-2007 | The integrated internet protocols in Rebol is a great strenth. S- | |
DanielSz: 3-Jun-2007 | The guru in terms of explaining programming concepts in Rebol is Ladislav Mecir. His articles are a must. | |
DanielSz: 3-Jun-2007 | Carl said in his rebol 3.0 front line blog: In REBOL 3.0, closure functions are implemented with the closure! datatype and a new mezzanine function called closure. That is significant in terms of programming techniques. Ladislav shows how you can achieve them in Rebol 2. http://www.fm.vslib.cz/~ladislav/rebol/contexts.html | |
DanielSz: 3-Jun-2007 | In the preface to Structure and Interpretation of Computer Programs, Abelson and Sussman state “First, we want to establish the idea that a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Thus, programs must be written for people to read, and only incidentally for machines to execute.” | |
Chris: 3-Jun-2007 | Perhaps that should be concise -- the expressive I guess is the ability to set the condition after the action, in a way that is easier for our brains to parse. Of course, the core of Rebol's expressiveness is that the language is built on top of a consistent, robust vocubulary (datatypes), though it can take time to learn how to construct the most expressive statements. Ruby is not instinctively reflective (is this the right term)? Now I'm rambling... | |
DanielSz: 3-Jun-2007 | Nice article, shows how modifiers are used in Ruby, a fine language by all accounts. I suppose you would resort to the dialecting facilities of rebol to achieve similar constructions. | |
Chris: 3-Jun-2007 | In dialects, it is possible to order things as you wish. In filtered-import.r, a rule can be followed by a condition message: foo: integer! else "Not an integer!" But that is limited to dialects. In Rebol proper, you'd be limited to: while [camera/memory-available?][capture-image] or until [capture-image camera/memory-full?] | |
Sunanda: 3-Jun-2007 | Scalability/maintainabilty are an important issues. Carl, in an early Zine article shows a way of shortening a REBOL assignment: http://www.rebolforces.com/zine/rzine-1-02/#sect10. Clever, but I was never convinced it added to maintainability -- what if additional processing was needed when settimg data to "active" ? | |
DanielSz: 3-Jun-2007 | From the article: The key is to know that keywords like return, while, if, unless, and until can be used as modifiers. This means that you put the conditional part after the keyword. Sounds silly, and sometimes it is. But sometimes it has a big payoff. | |
Anton: 4-Jun-2007 | In rebol I can make my own function to order the condition and action arguments how I want, but, as easy as this is, I generally avoid this and just use Rebol's built-in control functions. This means that other users can understand what my code is doing without scraping around looking for the custom control flow function that I put somewhere. (I put myself in the "other user" category after a few weeks have passed since writing the code...) | |
Anton: 4-Jun-2007 | So I gnash my teeth sometimes at the argument order in some functions, wishing for the order to be different, but it is a perfectionist restriction I'm putting on myself, really. | |
Anton: 4-Jun-2007 | Oops, I should have read the article first. (post_comments unless @not_read_article?) Of course, in rebol, you can't put the action block before the condition unless it's in a dialect that allows that. | |
Gabriele: 4-Jun-2007 | if it's just to be english-like, we can beat them any time with a simple dialect :) | |
Gabriele: 4-Jun-2007 | i don't think performance would change a lot | |
Gregg: 4-Jun-2007 | Since REBOL requires a programmer to think differently", in general what type of person, skill set, and/or background is required for a person to be a good REBOL programmer?" You just have to be open minded, and I think it helps to be curious. You also need to understand that REBOL is high level, but not safe in the sense of being dumbed-down so you can't do dangerous things. You can do *very* dangerous things in REBOL. You don't have direct mem access, so the risk is mainly to your own app, but since it's almost infinitely flexible, you can create works of art, or hideous beasts. "what attracted everyone on this newsgroup to REBOL? And, in general, what type of applications are people trying to build?" The small size, built-in GUI, and tiney-but-powerful demos are what attracted me initially. To be able to download the EXE, install it, and run 5 or 6 GUI demos in a couple miuntes just blew people away in 2001 when I showed it to them. What keeps me here is that there's nothing else that's as much fun to work in (for me). It can be frustrating too, I won't lie about that, but the benefits so far outwiegh the negatives for me, that I hate having to use other languages now. I also love the community. I would count some of the people here as close friends now, and it's very satisfying to collaborate with them, even just on fun little projects. What *really* excites me, though, is that I think we're still only tapping about 5% of REBOL's potential, maybe less. If you write code in REBOL like other languages, there are benefits but they aren't earth-shattering. When we get to the point that 10% of REBOLers write dialects, and 90% of REBOLers use them, and use REBOL as an interchange format, then we'll really be taking advantage of REBOL. | |
Geomol: 4-Jun-2007 | Rebolek, it shouldn't be too surprising, that performance is about the same, whether you use + or add. When you use 'add', REBOL still have to be prepared, if you put in an operator after each word. REBOL can't evaluate the final result after add 1 1 because what if you wrote: add 1 1 + 1 When real penalty for allowing infix operators can only be measured with a version of REBOL, that doesn't have them. | |
Geomol: 4-Jun-2007 | This might give a hint: >> rule: ['add set a number! set b number! (a + b)] >> time [loop 1000000 [parse [add 4 5] rule]] == 0:00:04.880101 >> rule: ['add set a number! set b number! opt ['+ set c number! (b: b + c)] (a + b)] >> time [loop 1000000 [parse [add 4 5] rule]] == 0:00:05.541085 The rule without infix + seems to be 10-20% faster than the one with infix +. This is only a hint! It might be different, if the language were changed. | |
Geomol: 4-Jun-2007 | If I allow infix + after each number, the result of course get worse: >> rule: ['add set a number! opt ['+ set c number! (a: a + c)] set b number! opt ['+ set c number! (b: b + c)] (a + b)] >> time [loop 1000000 [parse [add 4 5] rule]] == 0:00:06.360697 | |
Ammon: 4-Jun-2007 | Why did I join this community? The primary reason is to be part of a small, smart and passionate group who think differently That's basically the same reason I joined this community. Like many others here I found REBOL through the Amiga community. I had access to an Amiga 2000 when I was in elementary school and I loved it. When I decided to start programming I played with some Perl, some VB, some C and then I signed up to the Amiga Developers List in 2001, through which I found this community and I've never looked back... Since REBOL requires a programmer to think differently", in general what type of person, skill set, and/or background is required for a person to be a good REBOL programmer?" I think that those most likely to really grok REBOL are those that "think outside of the box." IMHO, anyone CAN be a good REBOL programer, like Gregg says, what you need most is an open mind. Curiosity does help.... A lot. There are a number of simple IQ tests that you can give people to determine their ability to "think outside the box." The way they approach the problem is as important as their ability to solve the problem because this shows you how they will attempt to solve problems they encounter while programming. Therefore, would a programmer with a computer science background with NON procedural languages like Lisp or ML be more likely to grok" and appreciate REBOL?" From what I have seen, they will pick up REBOL a lot quicker than those without the background in lisp or a language like Lisp, however this doesn't necisarrily mean that they will be able to write the best REBOL code... Would it make sense to hire" a young/new programmer out of college and get them involved with REBOL early so they have less "bad habits" to unlearn? Are any schools teaching their students REBOL?" There is a group here, "Rebol School", that we have been using to discuss the topic of learning/teaching REBOL. One of the users here, DenisMX, I believe has developed, or is at least working on developing a REBOL curriculum. | |
BrianH: 4-Jun-2007 | Geomol, I wouldn't know about R3 but in R2 ops are a little faster than their prefix equivalents. The reason is that DO already knows which words are ops, while it has to look up other words to figure out what they are. This lookup takes more time than just grabbing the right action out of the op table. It does have to retrieve the index into the op table from the value assigned to the op, but it's still faster than general action lookup. Try assigning a non-op value to an op word - it will error on evaluation. | |
BrianH: 4-Jun-2007 | Why did I join the community? Because when I joined, REBOL was still pretty new. R2 wasn't there yet - the first alphas for it came a few months after I started playing with the language. Most of the low-level behavior of the language was completely undocumented outside of RT, and they were still trying to position the language as easy to use, easy to learn, high level. It still looked like R1 - Scheme with a different syntax - but it was different. A challenge. So I dug in. I tested every function, everything I could find out. I asked a lot of questions on the mailing list. If they weren't answered, I dug in further and figured it out myself. And I got into a lot of really interesting arguments with the people on the list, testing and probing the language until all of the undocumented stuff became clear. Those early arguments became the low-level documentation of REBOL. And then came the books, and the community got bigger. I started using REBOL at work, even when it wasn't the language I was supposed to be using - code is easier to generate with REBOL than it is to write directly in other languages. More fun too. That's the hook: REBOL is fun. There is a principle I read in a Heinlein essay years ago: The principle of Creative Laziness. He wrote about the guy who invented the automatic pilot, back in World War 2, because piloting back then was a big hassle and he was too lazy to do it. Instead of doing the drudge work he did the more interesting task of figuring out how to automate it. If necessity is the mother of invention, then laziness is its father. Laziness is a virtue. That's what dialecting is all about: Automating the drudge work and wrapping it in a nice little language because it's more fun than doing it manually. More efficient too, a lot of the time. Do you know who REBOL appeals to the most? Engineers, scientists, hackers, analysts, problem solvers. People with opinions, people with enough of a twisted sense of humor, of the world, that they don't want to just sit still and accept the way that they are told the world is - they want to figure it out and remake it if necessary. Interesting people: REBOL's other hook. Welcome to the cool kids' table! | |
Will: 8-Jun-2007 | HELLO, do you have a simple solution, I'd like 'z to stay 10, eg it should be a local in the function z: 10 a: func ['word body][ foreach row [1 2 3][ set word row reduce body ] ] a z [print z] print z | |
Will: 8-Jun-2007 | this works but not in case of path: reduce replace body word 'row is it a bindology or parse job? | |
Gregg: 8-Jun-2007 | Look at the source for FOR. If that technique works for you, it will lead you to something like this: z: 10 a: func ['word body /local do-body] [ do-body: func reduce [[throw] word] body foreach row [1 2 3] [do-body row] ] a z [print z] print z | |
Will: 8-Jun-2007 | now the [throw] is just in case there is a catch in body, right? | |
Maxim: 14-Jun-2007 | rebol blocks have new-line control after each item in the block. depending on the function being used, these will be lost, kept or generated on the fly. usually anything which goes thru a string type will loose any previous new-line setup. and only ONE new-line can be kept per item. the 'NEW-LINE is the function to control this, if you really need to (its usefull for files in my mileage so far): help new-line | |
PatrickP61: 17-Jul-2007 | What is the best way to get an formatted timestamp that matches IBM DB2 in this form: ccyy-mm-dd-hh:mm:ss.nnnnnn I tried this, but I'm stuck on how to extract out the nanoseconds from Now/precise: Timestamp: rejoin [ now/year "-" now/month "-" now/day "-" now/time ".000000" ] Also, if the month or day is less than 2 digits, I need a leading zero -- how can I do this easily? | |
Sunanda: 17-Jul-2007 | Try this: rejoin [now/year "-" now/month "-" now/day "-" first now/time "." second now/time "." thir d now/time/precise "000" ] But you may need to add some more trailing zeroes.... a time of 01:02:03.100 would show in REBOL as 1:2:3.1 | |
Gregg: 17-Jul-2007 | I have a format func that isn't on REBOL.org (yeah, I know...; it requires another func, etc.) if you have to do a lot of formats and don't want to roll them all. Anyway, let me know if you want me to send it Patrick. | |
PatrickP61: 17-Jul-2007 | OK -- I'm perplexed as to when does things get evaluated. If I have a variable like Now-TS: to get the formatted time, it will be resolved immediately and return the time. If later, after I wait 1 second, I want to print the new formatted timestamp, it returns the exact same value as before, when I know the time has acutally changed. How do I get the time now to be resolved again? Example code: print now/precise gives 17-Jul-2007/14:35:21.308-5:00 wait 1 print now/precise gives 17-Jul-2007/14:35:22.324-5:00 now/precise is evaluated immediately Now-timestamp: rejoin [ Now/year "-" Now/month "-" Now/day "-" first Now/time "." second Now/time "." third Now/time "000" ] print Now-timestamp gives 2007-7-17-14.35.22.0000 wait 1 print Now-timestamp gives 2007-7-17-14.35.22.0000 the exact same time -- not evaluated immediately Is it this way because Now-timestamp has been assigned and already evaluated -- if so, how do I have it reevaluate it again? | |
BrianH: 17-Jul-2007 | Wrap it in a function. now-timestamp: does [rejoin [...]] | |
PatrickP61: 17-Jul-2007 | Ok, so if a variable is unset, then it is evaluated when defined. If it is already defined, then it is not evaluated again unless there is a do or does? Is that right? | |
BrianH: 17-Jul-2007 | DOES is a shortcut for creating a function, DO evaluates its value directly. A variable is not evaluated when assigned - the value is, and then it is assigned to the variable. You don't really "define" variables in REBOL, but the distinction may be more complicated than you need to worry about for now. | |
BrianH: 17-Jul-2007 | You might consider that the time will march on during the course of your evaluation, so you might want to store it in a local variable, like this: pad0: func [x n [integer!]] [head insert/dup (x: form :x) "0" (n - length? x)] now-timestamp: func [/local n] [n: now/precise rejoin [ pad0 n/1 4 "-" pad0 n/2 2 "-" pad0 n/3 2 "-" pad0 n/4 11 "000" ]] | |
PatrickP61: 17-Jul-2007 | Thanks Brian. I will play around with it a little more. Just to re-iterate my understanding of rebol assignments A variable is not evaluated when assigned - the value is, and then it is assigned to the variable. You don't really define" variables in REBOL" So at the time of assignment, the text following the : is assigned to the variable but is not evaluated. That is to say the variable is like a pointer to the text string that was typed in. Does that mean that Rebol will not do evaluations until it needs to. For example: In-file: %file_path_name.txt In-text: Read In-file write %out-file-path-name.txt In-text <-- this is where the evaluation occurs to resolve all the above? Is that right? | |
BrianH: 17-Jul-2007 | Later on you can either do a full evaluation of the word by stating it directly ( a ) or you can just retrieve its value by using a get-word ( :a ). | |
PatrickP61: 18-Jul-2007 | Thanks for your patience with me. I'm wrong about the evaluation. It is done at the time of the assignment returing whatever value to the variable. The reason Now-timestamp had identical values, even after waiting 1 second was that it was evaluated once, with a value put into it, then the wait happened, then I simply re-printed the same value as before, because I did not re-do the variable. I think I was making it harder than it really is. I don't understand this statment: Later on you can either do a full evaluation of the word by stating it directly ( a ) or you can just retrieve its value by using a get-word ( :a ) Are you saying that I can simply type Now-timestamp to have it re-evaluated at that time? | |
btiffin: 18-Jul-2007 | a: 23 * 56 when interpreted will compute 23 * 56 then the set-word a: assigns the value 1288 to the variable a. Because it is just a number a and :a are both 1288, you can't really get at the 23 * 56 anymore, that expression has been evaluated and "forgotten", forgotten not really a good word, but the expression 23 * 56 is not around anymore, only the 1288. | |
btiffin: 18-Jul-2007 | Patrick; I just looked back a little bit, your question about formatted time-stamps...Chris has donated an awesome date time formatter to the rebol.org repository. Very close to strftime in function. Check out http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=form-date.r | |
PatrickP61: 18-Jul-2007 | btiffin -- Thank you for taking the time to explain it. I think I understand it now. I was initially confused because I tried to print a timestamp knowing full well that time is changing and I didn't understand how to get it evaluated. I confused the assignment of a value with that of a function.. Good info on the date timestamp above. Thank you all! | |
Gregg: 18-Jul-2007 | If you read the Core manual on REBOL.com, it has a pretty good explanation of the four word types (normal, lit, set, and get). The other thing to understand is when blocks, and nested blocks, are reduced (evaluated). That can be tricky to figure out sometimes, because funcs like PRINT do it automatically. If you can get a handle on when things are evaluated--and don't stress when you have to add a REDUCE or COMPOSE but aren't sure why--and if you can grok the four word types, you 'll be in great shape. | |
Gregg: 18-Jul-2007 | When getting started, you can quite often treat REBOL like many other languages; it has a nice facade to let you get a lot done that way without forcing you to understand how it really works. | |
btiffin: 19-Jul-2007 | rebol.org %form-date.r updated... Fix for time-stamps and a really nice short-cut that includes the zone. %c outputs all the fields of now/precise nicely formatted %s outputs the seconds with nanosecond precision nicely formatted form-date now/precise "%C%y-%m-%d-%H:%M:%s" is now all you need for IBM DB2 time-stamps. | |
Graham: 19-Jul-2007 | doing this in math causes a few problems! | |
btiffin: 19-Jul-2007 | Patrick; No problem about library entries. :) When REBOL grows we all benefit. Nothing in rebol.org is 'official'. It's a user maintained repository of 'stuff'. Chris' form-date just happens to be one of the beauties. It is close to but not the same as the C strftime function. With form-date you can make up pretty much any date time output you'd like. No one has to use form-date, I was just cheerleading. So I'll cheerlead a liitle bit. I you haven't yet, check out http://www.rebol.org.Sunanda and team have created a a world class repository of information and functionality that is all REBOL user community generated. | |
PatrickP61: 19-Jul-2007 | Thanks btiffin -- Yes I agree that having a library of common routines is the way to go. I'm new and just learning how to play with Rebol with the approach of -- If I do it this way, what will rebol do, rather than, use the library to find common routines, and use it, which of course I would do to solve a specific problem. Rebol.org is a great resource! | |
PatrickP61: 19-Jul-2007 | Hi all, As you may have guessed from my above posts, I'm trying to write a script that will convert a formatted report into a table or CSV. I'm new and just playing around to understand the process. In any event, I did search rebol.org on CSV and found the CSV.r script which seems to a part of what I would like to do. But here is my concern. The Mold-CSV function does not handle all the different kinds of strings that can occur. I'm talking about embedded " or {. I would like a function that can handle all strings properly into CSV. Take this example: In-block: [ [ "C A1" "C B1" ] [ 2 3 ] [ "2" "3" ] [ "4a" "4b" ] [ "5a x" "5b y" ] [ ""7a,"" ""7b,"" ] [ ""a8""" ""b8""" ] ] Mold-CSV In-block doesn't handle 7a or a8 lines properly since the "" terminates a string. You could replace the first and last " with a brace {} but that does some funny things too. | |
PatrickP61: 19-Jul-2007 | Working in reverse, If you go into Microsoft Excel and type in your desired contents, you will see how they do it: - If a cell has embedded commas, then " are put around the entire cell contents. - If a cell has embedded " like abc"def, then the " is repeated as "abc""def". just food for thought | |
btiffin: 19-Jul-2007 | Patrick; This is pretty common with a lot programming, escaping quotes inside strings. And Henrik, just beat me to it and offered up a starting point... :) | |
Anton: 19-Jul-2007 | Rebol molds long strings, or strings which contain a quote " inside { } instead of " ". | |
Anton: 19-Jul-2007 | The string I typed above contains an open brace and a double-quote (which I've escaped). Rebol probably saw that the string contains an escaped quote and decided to mold it with { } to avoid having to escape it. However, now the opening brace { needs to be escaped. | |
Anton: 19-Jul-2007 | I don't understand the exact logic of the CSV file quote formatting, but you could use a function similar to this: enquote: func [string][rejoin [{"} string {"}]] >> print enquote "hel^"lo" hel lo" and you could take it further by replacing single instances of " in the string with two instances, etc. | |
Anton: 19-Jul-2007 | Wait a minute ! MOLD handles any value, while MOLD-CSV-STRING only handles series at the moment... hang on. | |
PatrickP61: 19-Jul-2007 | Anton, What do you think of this approach -- I'm just thinking it through and am not sure if I have covered all the bases. Since my input can contain any number of symbols, commas, single and double quotes, and rarely, but possibly braces, what if I attack the problem a different way. Whenever an embedded comma, or double quote or something like that occurs within an spreadsheet cell, it will require some kind of "extra" formatting like two quotes or the like. It may even be that there are unique combinations of such symbols, rare as that would be, to have complex formatting of an input block for rebol to convert it properly for CSV. What if I shift gears and look at a TAB delimited file instead. I know that I will never have TAB embedded in my cells, and that I deal with the entire block as a series instead. I could embed TAB wherever needed to separate the columns and leave the remaining string the way it is. Would that work, or would I still need to do some formatting to handle it. I think I'll open an excel spreadsheet, and work in reverse to see what it needs for TAB delimited file. Any comments? | |
Anton: 19-Jul-2007 | That may alleviate the string quoting problem. Worth a try. | |
PatrickP61: 20-Jul-2007 | I also checked out tab delimited and the rules for that is much much simpler. If a quote or comma is embedded in the string and does not start with a quote, then I can leave the value as it is. The only thing I need to handle is if a value starts with a quote, then I need to add additional " around it, which I should be able to do! | |
PatrickP61: 20-Jul-2007 | For those of you monitoring and want to see what I mean: Out-string: [ ; (want in tab file) ; (want in excel) {Col A1^-Col B1^/} ; Col A1 Col B1 ; Col A1 Col B1 {2^(tab)3^(line)} ; 2 3 ; 2 3 {'3^-'4^/} ; '3 '4 ; '3 '4 {4a^-4b^/} ; 4a 4b ; 4a 4b {5a""^-"""""5b"^/} ; 5a"" """""5b" ; 5a"" ""5b {"""6a x"""^-6b y^/} ; """6a x""" 6b y ; "6a x" 6b y {7a, x^-7b," y"^/} ; 7a, x 7b," y" ; 7a, x 7b," y" {8a ",x^-8b "" y^/} ; 8a ",x 8b "" y ; 8a ",x 8b "" y {"""9a"" x"^-9b "y"^/} ; """9a"" x" 9b "y" ; "9a" x 9b "y" ] write %Book2.txt Out-string Aside from just need to insert a ^(tab) or ^- at the appropriate places to separate a cell from each other, and a ^(line) or ^/ in a string, I will also need to check the first character of each "cell". If it starts with a ", then I need to add another set around it. See 5b and 9a above to see what I mean. | |
Henrik: 20-Jul-2007 | also I don't know if I understand your problem correctly. it's a bit hard to follow. :-) | |
Gregg: 20-Jul-2007 | Just skimmed here, so no new advice to add, except to say that this is one of those cases where it's impossible for REBOL to get it "right", because everybody has different rules about how it should work. I agree that the Excel model is a good one, and I would like to see it support that. REBOL also treats things differently based on whether there are spaces adjacent to the quotes or not, making it even more fun. http://www.rebol.net/cookbook/recipes/0018.html | |
PatrickP61: 20-Jul-2007 | My end goal is to be able to take some formatted text of some kind, something that is generated by a utility of some kind, and generate a spreadsheet from it. The formatted text can be of any type including " and the like. I'm working in reverse, by creating a spreadsheet in MS excel with various kinds of data that I've shown above. Some data with just alpha, just numbers, combinatins, leading quotes, trailing quotes, embedded quotes, embedded commas, spaces etc. Then I saved the spreadsheet as CSV and another version as Tab delimited. Then by looking at those files via notepad or other editor, I can see how the data must be in order for MS excel to accept it. I initially had problems with the CSV model because embedded qutoes needs other qutoes added to that "cell" if you will. The Tab delimited model has less restrictions on it. The only thing that needs attention is when a "cell" starts with a quote, which needs additional quotes added to it. Embedded qutoes or trailing qutoes don't need any modification. Long story short -- I'm going with Tab delimited model and figuring out a rebol script to take data from an IBM utility dump (with rules on what data to capture), and model that info into an excel spreadsheet via Tab delimited file. | |
PatrickP61: 20-Jul-2007 | Hi Gregg -- The cookbook recipe is a good one for reading and processing CSV's as input. My main issue is NOT the CSV part itself. It is pretty simple really. But as usual MS has some additional formatting rules whenever certain characters are embedded, and that is the part I'm having trouble with in order for a CSV file to be loaded as a spreadsheet. You don't happen to have one that lets you write CSV files as output for excel (with all the special rules etc)??? :-) | |
Gregg: 21-Jul-2007 | I don't , but let's see how close this gets us. First, here is a support func for building delimited series. In addition, you'll need my COLLECT func from REBOL.org, or something similar. | |
Gregg: 21-Jul-2007 | delimit: func [ "Insert a delimiter between series values." series [series!] "Series to delimit. Will be modified." value "The delimiter to insert between items." /skip ;<-- be sure to use system/words/skip in this func size [integer!] "The number of items between delimiters. Default is 1." ][ ; By default, delimiters go between each item. ; MAX catches zero and negative sizes. size: max 1 any [size 1] ; If we aren't going to insert any delimiters, just return the series. ; This check means FORSKIP should always give us a series result, ; rather than NONE, so we can safely inline HEAD with it. if size + 1 > length? series [return series] ; We don't want a delimiter at the beginning. series: system/words/skip series size ; Use size+n because we're inserting a delimiter on each pass, ; and need to skip over that as well. If we're inserting a ; series into a string, we have to skip the length of that ; series. i.e. the delimiter value is more than a single item ; we need to skip. size: size + any [ all [list? series 0] ; lists behave differently; no need to skip dlm. all [any-string? series series? value length? value] all [any-string? series length? form value] 1 ] head forskip series size [insert/only series value] ] | |
Gregg: 21-Jul-2007 | fmt-for-Excel: func [blk dlm] [ rejoin delimit collect fld [ foreach val blk [ val: form val replace/all val {"} {""} if find val #"," [val: rejoin [{"} val {"}]] fld: val ] ] dlm ] fmt-for-Excel [{"A"} "B" "C,C" {"4,4"}] #"," | |
Gregg: 21-Jul-2007 | If this output looks correct, then you just need to test it some more, with other possible scenarios. >> fmt-for-Excel [{"A"} "B" "C,C" {"4,4"}] #"," == {""A"",B,"C,C","""4,4"""} |
19201 / 64608 | 1 | 2 | 3 | 4 | 5 | ... | 191 | 192 | [193] | 194 | 195 | ... | 643 | 644 | 645 | 646 | 647 |