World: r3wp
[I'm new] Ask any question, and a helpful person will try to answer.
older newer | first last |
Gregg 2-Aug-2007 [662x3] | The online Core guide is still the best overall language reference IMO. |
Core manual rather; agreeing with Brian. | |
Sometimes MOLD can be very helpful, along with TYPE?, to see if things are what you think they are. NONE, datatypes, etc. can be tricky at times, to know if they are a word or the value. | |
Geomol 2-Aug-2007 [665] | Is there a list anywhere of what values are actually their expected values, and what values are seen as words, when inside a block? As in: blk: [none 1 1.2 integer! [email-:-somewhere-:-net] #an-issue 127.0.0.1] etc. etc. If not, someone should make one such list! |
Gregg 2-Aug-2007 [666] | All words are seen as words, unless reduced. >> blk: [none true :word word: 'word integer! 1 1.0 1.0.0 $1 1x1 "string" <tag> [name-:-host] #i ssue] == [none true :word word: 'word integer! 1 1.0 1.0.0 $1.00 1x1 "string" <tag> [name-:-host] #issue] >> head forall blk [change blk type? first blk] == [word! word! get-word! set-word! lit-word! word! integer! decimal! tuple! money! pair! string! tag! email! issue!] >> blk: reduce [none true 'word integer! 1 1.0 1.0.0 $1 1x1 "string" <tag> [name-:-host] #issue] == [none true word integer! 1 1.0 1.0.0 $1.00 1x1 "string" <tag> [name-:-host] #issue] >> head forall blk [change blk type? first blk] == [none! logic! word! datatype! integer! decimal! tuple! money! pair! string! tag! email! issue!] |
Anton 3-Aug-2007 [667] | Geomol, such a list cannot be made, if I understand you correctly. |
Geomol 3-Aug-2007 [668] | Ok, why not? I was thinking about something like Gregg just did, but with all the datatypes. Putting the different datatypes in a block with a simple assignment and then check, how they're seen by REBOL. |
btiffin 3-Aug-2007 [669] | Carl wants such a list for form, mold, to string!, format (but that's R3), add the serial form, score some points and help the beginners in one grand pdf-maker datatype file. Not much to ask, is it John? :) |
Geomol 3-Aug-2007 [670] | I would be cool, if we could kick some of the new ones to make such a list. It would be a good learning experience. |
btiffin 3-Aug-2007 [671] | I think it'll be a very useful and worthy entry for DocBase, but it would also be nice to use Gabriele's PDF-MAKER or other page layout for a nice reference sheet printout. |
Geomol 3-Aug-2007 [672] | *It would be cool* |
Henrik 3-Aug-2007 [673] | hmm... that's a good idea. :-) |
btiffin 3-Aug-2007 [674] | So...get RT to open DocBase and I'll start right now, oh yeah and R3 beta for access to format :) Kidding... I was going to be playing with PDF-MAKER today, to see if I can add print functionality to the Desktop Librarian...maybe I'll use this as a good way learn the dialect. So unless someone else steps up...I'll take a kick at it, for R2 datatypes anyway. |
Gabriele 3-Aug-2007 [675] | hmm, not sure i understand here. what do you want to add to docbase? |
btiffin 3-Aug-2007 [676x2] | I was just kidding...I'm about half way through using your pdf-maker (v2) to document the R2 datatypes regarding to string! form mold. Blog http://www.rebol.net/r3blogs/0092.htmlbut like I everything I do now-a-days, it comes pre-expired :) |
To all...by the way, check out Gabriele's pdf-maker.r in rebol.org (the docs have a pointer to the new in-progress work for pdfm2). Maybe we'll get printing from REBOL sooner than later. :) | |
Gabriele 4-Aug-2007 [678] | ah, a table with all datatypes and how they convert to string? that didn't seem to be what John was talking about :) anyway... we have something like that ;) |
btiffin 4-Aug-2007 [679] | True. John is (I think) talking about a little more, the unevaluated, evaluated, versus serialized issue. Like when is false false, versus (non-obviously) 'false and true. |
Geomol 4-Aug-2007 [680] | Yeah, it started with you Brian pointing out, that none is not always none. I then extrapolated on that idea to include all datatypes, not just none!. |
Gabriele 4-Aug-2007 [681x3] | none is always a word. of course, if you reduce the word, you get the value. like print is always a word, but if you get it you get the function :-) so there is no mistery, words are just words. |
the issue is another - that some values do not have a mold representation. | |
they should all have a mold/all representation though (well, of course there are exceptions, like native! and so on.) | |
Geomol 4-Aug-2007 [684] | The problem is maybe to distinguish words from other things. Is integer! a word? Is [gabriele-:-somewhere-:-world] a word? Try: blk: [integer! [gabriele-:-somewhere-:-world]] type? blk/1 type? blk/2 |
Gabriele 4-Aug-2007 [685] | obviously integer! is a word |
Geomol 4-Aug-2007 [686] | :-) It may not be obvious to everyone! We're in the "I'm new" group. |
Gabriele 4-Aug-2007 [687x10] | there are only a few special chars |
like @ and : | |
no, i'm saying, that you don't need a table, you just need to know the syntax | |
1) words cannot start with a digit | |
so, if it starts with a digit, it's not a word | |
2) words cannot contain " @ : $ % ( ) [ ] # | |
so if you have one of those chars, it's not a word | |
ah, , too | |
3) / is a special case, in that / // /// //// are words, but otherwise you can't have it in words | |
there may be one or two more rules, but that's it. you don't need a table. | |
Geomol 4-Aug-2007 [697] | Good explanation! |
Gabriele 4-Aug-2007 [698] | eg you can't start with ' either |
Geomol 4-Aug-2007 [699] | I still think, it will be good to have a list of examples, so it can be actual seen, what all this means. You and I understand it, but does everyone else? |
Gabriele 4-Aug-2007 [700x4] | i think, these should be listed somewhere in the core guide. |
hmm. examples of valid and invalid words? agreed. but it's a different thing from a table with all datatypes and saying that some of them are words - that's confusing; only values of the word! type are words. | |
what you say instead is that some values do not have a mold representation, so that they mold to something that once evaluated, returns the value (eg make object! ... and so on). | |
it's to avoid letting people grow with "wrong" ideas ;-) | |
Geomol 4-Aug-2007 [704] | We might move to beyond "I'm new" here, but we have a slighty different understanding, I think. none is always a word There is a possible trap here for the new one. This is output from my terminal: >> blk == [none] Is that "none"-word a word in the REBOL understanding of a word? It depends on, how I made it. Did I write: >> blk: [none] == [none] or did I write: >> blk: [] == [] >> append blk none == [none] For the programmer being new to REBOL, it may be hard to see the difference. And the sentence "none is always a word" may only apply to the situation, where values are being fed into REBOL, not when I write: >> blk == [none] Or what? |
Gabriele 4-Aug-2007 [705x5] | that's the difference between not having a mold representation and having it. |
none values mold to a word. so, yes, it's a word you see there. | |
you see a word not because there's a word in the block, but because none values mold to a word. | |
it's MOLD the issue here, not NONE!. | |
(neither WORD!) | |
btiffin 4-Aug-2007 [710x2] | Gabriele; "there is no mystery, words are just words". I'll reiterate what John said. It may not be obvious to everyone. It's like tying your shoelaces. Once you know, you just "know" and it becomes impossible to "not know". But until then it's a mystery and you trip over your shoelaces. none always looks like none. There is nothing obvious in a: none a: [none] until you trip. Then you know, kinda. It is very very easy to trip over if first [false] ["I trip"]. The fact that false and #[false] are two completely different things needs to be disseminated to the new user, explicitly. Mainly because in trheory it is obvious, in reality it is mysterious. |
And as you are pointing out now...the issue is goes deep enough to warrant discussion among high level REBOL programmers, although perhaps not at the 'tieing shoelaces' level. :) | |
older newer | first last |