« first day (2433 days earlier)      last day (1347 days later) » 

1:17 AM
@GrahamChiu thanks. The bot is still not alive - see chat.stackoverflow.com/transcript/message/37857200#37857200
 
1:28 AM
@Edoc Sounds sophisticated. Any chance you might share some of your insights from your experience on this forum topic?
 
@johnk testing from console
@johnk I'll send you my entire script ... but that error means you're getting an unhandled redirect
You just need to put a err: trap [ write .. ] and probe err to see what where the redirect is going to
Ok, I've sent you the so-speak.reb script
 
@RebolBot Thanks. It will be the weekend before I get time to have a proper look
 
What we need is a script that automatically handles redirects, or a fix to the prot-http.reb to do this.
 
1:49 AM
@Brett Yes, absolutely. I intend to write a public article for a simple version of the dialect. SQL makes a nice DSL -- the (basic) syntax is familiar to nearly all developers. It will be enough of a challenge to introduce Red and Parse-- I don't need yet another syntax in the mix.
 
 
2 hours later…
4:19 AM
@Edoc This is what I'd had in mind:
Jun 23 at 20:39, by rgchris
items: [
    2017-06-22 "From Yesterday"
    2017-06-23 "Is Today"
]

build-xml [
    <feed> [
        <title> "A Blog"
        foreach [date entry] items [
             <entry> [
                  <title> :entry
                  <updated> :date
             ]
        ]
    ]
]
With variables, IF's and EITHER's and the like. Imagine being able to do this in VID:
view [
    h1 "Header"
    foreach item ["some" "items"][
        if string? :item [text :item]
    ]
]
Gets messy if you try to do this with Parse alone.
item-template: [text :item]

view [
    h1 "Header"
    foreach item ["some" "items"][
        if string? :item :item-template
    ]
]
 
4:34 AM
Sounds like you're trying to do rebol web pages
Can't you just reuse your RSP code?
 
No—it's more subtle than that.
With RSP, I just convert anything outside the <% %> into PRINT statements and the whole thing becomes Rebol code. What I'm trying to do above is to bake control functions into a dialect.
Also I want to limit the functions available, so it's not just a case of converting dialect -> Rebol code.
Perhaps I am trying to be too ambitious, but it's really probably a case of building a dialect interpreter.
 
Like VID?
 
No—VID uses Rebol (DO) constructs and in a limited way.
VID uses DO/NEXT to evaluate a single value. You just can't say things like:
item-template: [text :item]

view [
    h1 "Header"
    foreach item ["some" "items"][
        if string? :item :item-template
    ]
]
Closest equivalent would be to precompose the block with e.g. COLLECT.
item-template: [text (item)]

view collect [
    keep [h1 "Header"]
    foreach item ["some" "items"][
        if string? :item [keep bind compose :item-template 'item]
    ]
]
@GrahamChiu you get a chance to try the Twitter changes?
 
4:54 AM
@rgchris Not yet.
Let me look now
that room name is wrong now
Doesn't cause a redirect though
@rgchris Why did you comment out the name and type in twitter.r3?
 
The module/module name? Kept crashing in my tests. Doesn't need to be a module anyway—is fully self-contained as-is
 
@rgchris but you have an 'exports header
 
Oh, wait—it only crashes if they're LIT-WORDs. That's not right, but will change them for now to get it working correctly.
 
well, I merged it meantime
 
Should still work but is not a module.
Exports header means nothing if it's not a module.
 
5:07 AM
the config is probably called twitter-config.r3 still
>> do https://raw.githubusercontent.com/gchiu/rebolbot/master/twitter.r3
Script: Twitter Client for Rebol Version: 0.3.7 Date: 10-Jun-2013
** Script Error: load does not allow blank! for its source argument
** Where: take make case construct context do catch either either --anonymous-- do
** Near: object! load system/script/args ??
** File: ../src/core/c-eval.c
** Line: 1115
ⓘ Note: use WHY for more error information
 
Indeed. Can change that.
 
    config: case [
        block? system/script/args [
            make object! system/script/args
        ]

        file? system/script/args [
            make object! load system/script/args
        ]

        exists? %twitter-config.reb [
            make object! load system/script/args
        ]

        /else [
            do make error! "No Configuration Provided"
        ]
    ]
it's not actually loading the config anywhere
 
Hm. Another change or two required.
Should change the config file to .reb though—that is the extension we're running with, right?
 
@rgchris yeah but at present they're all .r3
that was a task for another day :(
 
Can DO/ARGS it with a custom filename anyway.
I don't actually see where the Twitter script is invoked...
 
5:19 AM
>> twitter/as "RebolBot"
== "RebolBot"

>> twitter/update/override "I'm alive again #Rebol"
** Access Error: protocol error: "Server error: HTTP/1.0 403 Forbidden"
** Where: fail switch awake switch check-response switch --anonymous-- wake-up either until --anonymous-- wait until sync-op either --anonymous-- write send update
** Near: _ fail error ??
Is that useage as a standalone app?
 
Yes. Don't know how to test as RebolBot.
 
How does it get the api target?
>> twitter/update/override "I'm alive again #Rebol"
** Script Error: url-encode word is not bound to a context
** Where: reduce if repend case join-of rejoin sign compose switch send update
** Near: "&" replace/all url-encode ?? form lookup "%5f" ...
** File: ../src/include/sys-bind.h
** Line: 288

>> url-encode
** Script Error: url-encode is missing its text argument
** Where:
** Near: ... url-encode ??
** File: ../src/core/c-eval.c
** Line: 957
 
I have the 'RebolBot' Twitter credentials, but don't know how to test from the RebolBot API.
 
I'm just trying to test as a standalone
 
That's the latest error I get. Why is it not importing URL-ENCODE correctly from import <webform> ?
Module issues, most likely...
Ugh.
Likely gets back to the difference between import <webform> and needs: [<webform>] from a module.
 
5:43 AM
body: => {{"errors":[{"message":"SSL is required","code":92}]}}
** Access Error: protocol error: "Server error: HTTP/1.0 403 Forbidden"
** Where: fail switch awake switch check-response switch --anonymous-- wake-up either until --anonymous-- wait until sync-op either --anonymous-- write send update
** Near: _ fail error ??
 
What's going on there?
Where is the list of <modules> ?
 
what's the oauth_consumer_key ??
I don't have that
 
Should be in the config file.
Comes from the App registered with Twitter.
 
johnk didn't give it to me
 
Ah—thought you were testing it on site.
 
5:52 AM
body: => {{"errors":[{"code":32,"message":"Could not authenticate you."}]}}
@rgchris Would you skype it to me?
append lib compose [url-encode: (:url-encode)]
 
Hm, if I can remember my Skype password :)
 
just paste it here and then delete it
 
I really hate password prescriptions. Does no-one read XKCD?
 
I generate 15 char long passwords using a JS tool .. supergenpass.com
only need to remember the seed
 
6:13 AM
Really need to clean up the module code next.
 
I'm alive?
 
6:34 AM
@rgchris If I import webform before I import twitter, then I can use it as a a module
import <json>
import <webform>
import %twitter.reb

and I don't need this line

append lib compose [url-encode: (:url-encode)]
 
@rgchris The author of StringTemplate is adamant that the choice of functions available to a template should be constrained. I haven't used it, but I'm interested in the idea and whether it would be useful to be generalised to rebol blocks. Also, I was interested to see that he compiles his templates to a bytecode.
I should have wrote "choice of operations" - assignment and general logic is banned.
 
6:51 AM
Latest Rebol3 downloads are indexed at http://metaeducation.s3.amazonaws.com/index.html #Rebol
Testing importing <webform> before importing <twitter> #ReBol rulz
I don't need the append lib line afterall #ReBol
 
@HostileFork is that right? the exports from a module are not available to a module that imports them?
 
 
2 hours later…
9:16 AM
@GrahamChiu Module code is mostly userspace. I need people to explain them to me, vs. the other way around.
I've said that, one of the biggest things Rebol has to explain--is the meaning and relevance of binding, and what it means to create a polymorphic operation that is singly bound but knows how to dispatch different types, vs. pointing the operation to different functions entirely... how is this used, when is it used. It's like explaining something like operator overloading and when to use it or not
It's the "fun" and "wild" aspect of it. I see Nenad and Peter Wood talking excitedly about the idea that you dump code and if it says print [x x x] and they point to different x then they'll colorize them differently. But of course, I think they're glossing over bigger questions.
 
9:59 AM
posted on June 29, 2017 by @hostilefork Brian Dickens

@hostilefork wrote: At its core, Rebol has the idea that any PATH! or WORD! might be a function, and it might wind up dispatching it. There is no special syntax for function calls or delimiting. Reading a line of code like: foo baz bar/:mumble frotz ...could be pretty much anything. >> foo: 10 >> baz: 20 >> bar: [asdf ghijk 30 lm

 
 
2 hours later…
11:51 AM
@rgchris Sounds interesting. I'm not there yet with the SQL dsl, but one of the first things I intend to use it for is to build a demo of a static site generator (like Hugo or Jekyll). I use a rebol static site generator to manage and upkeep a bunch of sites for work (15k pages using XML feeds), but my code is messy, and building up a clean data structure from SQL and then injecting into HTML templates would make things easier on whoever inherits it.
 
12:08 PM
@rgchris My plate is pretty full at the moment, but let me know if you think there's any synergy with what I described. I can't imagine that anything I'm working on would be novel to you, however.
 
 
4 hours later…
3:42 PM
In the world of operators and the "more powerful * versions", I'm thinking EVAL should only evaluate functions, while EVAL* evaluates everything.
So eval quote a: 3 will effectively become quote a: 3, and not assign 3 to a
But eval* quote a: 3 will effectively become a: 3, and assign 3 to a.
We need a way to write the equivalence between these with a variadic, so that EVAL could be written correctly in userspace in terms of EVAL*.
 
4:46 PM
@giuliolunati What would you call a variadic eval operator, e.g. eval: func [x [<opt> any-value! <...>]] [name-this-function x] where eval :add 1 2 is 3? It could be a refinement with no args, e.g. eval/variadic, since eval is already variadic (though not a good fit if its defined self-referentially in userspace like this). Or a different operator.
We can also have an enfixed eval operator ("enval"?). 1 enval :add 2 for instance, could be 3.
Above, note spec is name-this-function: [x [varargs!]] [...]
If we have that name-this-function, then it becomes a newer and smarter way to relatively easily "bounce" evaluations, that must formally describe its contract via its variadic interface...I feel this corrects the complaints that marred RETURN/REDO.
7
Q: Why does return/redo evaluate result functions in the calling context, but block results are not evaluated?

HostileForkLast night I learned about the /redo option for when you return from a function. It lets you return another function, which is then invoked at the calling site and reinvokes the evaluator from the same position >> foo: func [a] [(print a) (return/redo (func [b] [print b + 10]))] >> foo "Hell...

 
5:02 PM
posted on June 29, 2017 by @hostilefork Brian Dickens

@hostilefork wrote: Historically it is not possible to dispatch infix functions from a path. In Ren-C it's very nearly technically possible, with one problem: so long as PATH! can contain a GROUP!, it can't be "sniffed" for whether it looks up to an infix function without potentially having side effects. Consider, for example: do/next [1 foo/(print

 
With name-this-function, you could, if you wished, make a form of FUNCTION whose implementation of RETURN (remember RETURN is now "userspace") offered RETURN/REDO. But that variant would make all of its functions variadic by contract, because you never know if they're going to act like RETURN/REDO. Which is at least more honest.
I feel like I might be repeating myself; I think I've pointed this out before.
That form of FUNCTION could be just plain FUNCTION, with an annotation or refinement. add-n: function [return: [<redo> any-value!] x [integer!]] [return/redo specialize 'add [value1: x]] => spec-of add-n => [x [integer!] dummy-arg [<opt> any-value! <...>]], add-n 10 20 => 30
 
 
3 hours later…
8:32 PM
@Edoc Will do. It's an area that has been on my mind for the longest time and I just can't quite get a handle on what to do or how to go about it. I do hope something will emerge from the discussion. (thread link reminder)
 

« first day (2433 days earlier)      last day (1347 days later) »