« first day (1961 days earlier)      last day (1819 days later) » 

1:56 AM
>> also #[unset!] unset 'x
 
; Brought to you by: try.rebol.nl
 
@RebolBot
also :x unset 'x
 
; Brought to you by: try.rebol.nl
 
>> also x unset 'x
 
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/script-no-value.html
    *** ERROR
** Script error: x has no value
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
2:00 AM
So even though ALSO allows a first argument with no value, you can't directly pass a word that has no value to it.
That's an error created by the DO dialect, not controllable by the user except via obfuscation.
I am sure it was meant to help users.
Whether that obfuscation (:x, error? try [x], whatever) is burdensome for the power user is of course another question.
 
2:24 AM
@MarkI Unknown word lookups have to cause errors in the evaluator, otherwise typos are pretty much silent.
 
2:45 AM
@HostileFork Typos in get-words are always silent. That has burned me before, and will again.
Especially since get-words are used for more than just unset-silencing.
 
@MarkI Well same in set-words, but this is why binding should not just allow anything.
The module system, if it worked, would help avoid the stray references on both writes and reads. It actually does do that specific thing with isolation, so I guess what I mean by "if it worked" is "if people understood it and it were clear enough that it were used universally"
 
@HostileFork Good point, I hadn't thought of that one!
Hm. If you are setting a word via a set-word, you might want it to error if it wasn't already set, to catch typos ...
 
3:03 AM
@MarkI Well you can't have it both ways. If you go around setting everything to blank to pre-format it for legal sets, then it won't trigger errors from reads.
People are pretty used to the idea that once you've assigned something, it's legal from then on... and that it's reads from unassigned variables that should be caught (if not paid for as a cost by the language itself, e.g. C "just takes your word" even if you're wrong, then by an analysis tool such as address sanitizer)
 
3:34 AM
>> if (print "should equality operators take optional args?") = () [print "if so, this works."]
 
; Brought to you by: try.rebol.nl
should equality operators take optional args?
if so, this works.
 
4:05 AM
I do wonder in the scheme of things if the better idea is indeed to go ahead and permit set-word assignments to void to unset them. The original motiviation for that was to make things like if value? x: :map/thing [print "it was present in the map"]. earl argued for if check-set x: :map/thing being quote-like and doing the same. (Note: this uses the new definition of "value?", which would be "any-value?" in the near-term.)
Get-word aside, if assignments from unsets were allowed then it would let you write while [value? x: take block] [do some stuff with x], where taking an empty block gave back a void. The cost--as we know--is locality of error, finding that place where the thing you expected to do an assignment actually left the variable unset. But if assignment is "disarmed" in a world where conditionals and other places are armed, how much a liability is it?
You do not--in general--have a magic wand in Rebol to locate the last assignment of values you later find you don't like. Better debugging tools could assist in that. Perhaps it could be enabled on a variable-by-variable basis...we've already discussed the idea of leveraging the type signature bits in objects...what if a variable could declare itself as being not optional? Or not taking integers? Etc?
e.g. what if the thing that kept certain variables from accepting an unset assignment was the same kind of thing that keeps some function arguments from accepting voids?
 
4:47 AM
Port of Red/View on OS X has started: http://tinyurl.com/ztmut49
2
 
 
3 hours later…
7:35 AM
@giuliolunati I had some initial trouble with Edge but it seems OK now (perhaps the page didn't fully download). Tried read from http but that didn't return anything. Print now, some simple calculations, simple loop all work well.
Interesting idea about adding typing to words.
 
@Brett So far, the experiment with getting rid of reified UNSET! is going well. Gotten through the tests, builds hostilefork.com, builds Rebol itself, working on getting it to build the old Red R3-Alpha port
Interestingly, since type-of () gives back a NONE! value, and a NONE! value in a typeset spec is how MAKE FUNCTION! reads that you want an optional, it means that unset!: none provides fair compatibility. It doesn't come back as datatype? unset! being true, but handles some cases.
And type?/word can be made to give back the word UNSET! (there is no TYPE-OF/WORD)
The compatibility layer is its own giant test case. It's also kind of a testament to the flexibility of the system--as I've said before.
make function! [[x [_ integer!]][if void? :x [print "optional parameter not provided"]]

...being equivalent to...

func [x [<opt> integer!]] [if void? :x [print "optional parameter not provided"]]
One could write that as if not set? 'x [...] and in a distant future when UNSET? is reactivated perhaps if unset? 'x [...]
Alternately as unless any-value? :x [...] which in a distant future when VALUE? is reactivated perhaps unless value? :x [...]
But for now, no UNSET? or VALUE? defined except in <r3-legacy>
 
8:33 AM
It makes a world more sense to speak of variables as being set or unset as opposed to values being set or unset. :-/ In particular to close this loop on the definition of a value, because if no-value is a first-class value itself you've got problems.
 
 
2 hours later…
10:08 AM
@Brett thx for testing! http and all of I/O is problematic, because JS environment. But I think will be easy add an option to execute a remote script e.g <link-to emscripten>?<script-url>
 
@giuliolunati The emscripten feature set has evolved with time, you can build it to package up with a filesystem for instance. I'd be surprised if they didn't have some network-oriented-bridge that could turn around and do some kind of XMLHttpRequest in the JavaScript...
 
10:46 AM
posted on March 14, 2016 by qtxie

FIX: the cursor does not show in some cases in gui console.

 
@HostileFork would be very interesting! I'll investigate.
 
 
2 hours later…
12:51 PM
>> reduce [1 + 2 () 3 + 4]
 
; Brought to you by: try.rebol.nl
== [3 unset! 7]
 
So the first real problem with changing that to produce a NONE! came in the form of what is the likely pattern of where that would be a problem, which was the usermode implementation of positional R3-Alpha-style APPLY. It's a pretty typical case. If you don't supply it with /ONLY it will reduce the arguments, and if you collapse voids to none then it doesn't distinguish none args from opted-out args. If you make the spot disappear it's even worse.
However, it's possible to do that another way now. And I think the "there's another way" line of thinking is going to have to be how the Expert Mode Programmers think about this, because reified unsets are too damaging to the whole of the system.
And one thing that might be nice in the "there's another way" thinking would be do-each and/or map-do-each. Something that lets you customize the response to evaluation easily, if you need to make a placeholder or something. map-do-each val [1 + 2 () 3 + 4] [either void? :val ['special-placeholder] [:val]] for example.
 
 
2 hours later…
2:34 PM
@giuliolunati It would be very interesting if you could wire up that emscripten build to one of the "Try a language online" consoles... they are open source generally. The first one was TryRuby, now there are tons of them... for instance tryhaskell.org
 
3:17 PM
@RebolBot
foo: func [:x [unset! integer!]] [
    if unset? :x [print "This hack exists to make HELP etc. work"]
]
(foo)
 
@HostileFork That's very interesting.
; Brought to you by: try.rebol.nl
This hack exists to make HELP etc. work
 
Had a thought that maybe if there was a specific error given when you hit the end of an input like that, and if the error itself had the function value in it, the REPL could catch the error...look and see the function could run with an optional argument, and re-run it by calling it with no argument. :-/
Or they could just be variadic.
 
>> transcode/error to-binary {#[block! #[block! #[block! #[block! []}
 
; Brought to you by: try.rebol.nl
== [[] #{}]
 
That has got to be a bug.
TRANSCODE without /ERROR fails, with the correct (missing-]) error.
 
4:07 PM
@MarkI I really do believe the future for transcode is as a PARSE feature.
Getting good errors and line number information are barriers there, though as I've also mentioned in the past, I think that would be nice for PARSE too.
I've previously griped that I think ? being taken for a REPL feature which is perfectly serviceably written as "help" and abbreviated through whatever assistive mechanics a repl might use (I suggested things like >> p plus space go to >> probe or whatever, and if you really want to refer to the single letter p you might say >> then leading space, then >> p, then space...). or vice versa. Whatever.
In that light, I'm wondering if this whole question of voids-to-nones-for-convenience might be tackled by something along the lines of ? foo/1 or similar, where that is a "quote and get but turn voids into nones"
@RebolBot
?: func [:thing [path! word!]] [
    either unset? set/any 'thing get/any thing [none] [:thing]
]

obj: object [a: 10 b: 20]
set/any 'obj/a #[unset!]

probe ? obj/a
probe ? obj/b

print "(difficult to make a good example in R3-Alpha)"
 
4:22 PM
; Brought to you by: try.rebol.nl
none
20
(difficult to make a good example in R3-Alpha)
 
4:41 PM
Maybe we're looking for a word besides GET. In fact... hmmm... with errors now caught by TRAP to match CATCH, TRY is available. TRY could be the kinder gentler GET. try 'foo/1 could give you a NONE! instead of an error if foo/1 would be unset. try x => to-value get/opt x
either x: try 'my-map/key [
    print "it's in the map!"
][
    print "it's not in the map"
    print "(or it's in the map and NONE! or false, but imagine this code doesn't care)"
]
Anyway, whatever one might call it, the point is not making it too verbose or hard to use. If it's no worse than GET (e.g. not a GET/XXX), then the kind of person who writes code like the above a lot would go "oh, I like this one better" and be happy. While the kind of person who thinks that's sloppy could stay away from it.
 
 
2 hours later…
6:33 PM
@HostileFork good idea! They work client-side, or require server-side support?
 
@giuliolunati The original TryRuby worked by sending each request to a server to evaluate, and the server would keep an interpreter running in a sandbox so that it could service successive requests and keep the state going. But it's probably a case of where you could find the place it sends off the request and instead make a call to the emscripten build like you are doing with the DO button... hopefully it wouldn't be too hard to do.
 
7:26 PM
Urgh. Just noticed a difficulty with Github issues. If you delete a reference, the targeted bug does not get its "referenced by #XXXX" cleared.
 
7:37 PM
"If GitHub's design intent was to make their users feel frustrated and stupid, then the design is a total success"
I see no cog icon, nor a way to obtain one. I want to add the Status.Dismissed label to a duplicated bug (#2092) that needs it. Help please.
 
 
2 hours later…
9:20 PM
Guys, I've been working on memory tracking in Rebol 3 for memory usage analysis recently, and now I have a working prototype. Check out my blog at zengshixin.blogspot.com if you're interested.
6
 
10:02 PM
@MarkI I did it, but am not sure the tickets are really identical. Nevermind.
 

« first day (1961 days earlier)      last day (1819 days later) »