AltME: REBOL3

Messages

GiuseppeC
Ooops... to many copies
The following code returns the dayofweek of /weeks/ ago
        dayofweek: 1
        weeks: 2
        date: either now/weekday = dayofweek
            [now - (7 * (weeks - 1))]
            [now - (((7 * (weeks - 1)) -  dayofweek) + now/weekday)]
GiuseppeC
Note that this formula is dangerous when you want to filter something from a start to and date because it includes TIME!
now should be changed to now/date
DideC
I have a generic calculation for dates:   date-of-monday: a-date + 1 - a-date/weekday
If you need a sunday, it become:   date-of-sunday: a-date + 7 - a-date/weekday
Then just add or remove (weeks  * 7)

GiuseppeC
Interesting
Arnold
What should same-day-next-month be today?

Gregg
That would be open to interpretation on a day like today. My call, when I wrote that func, was to use the last day of the month, if the next month has less days than the target month.
Alternately, you could throw an error or return none.
Arnold
Yes depends on what you want it to be.

Ashley
>> col: 1
>> do z: compose/deep [foreach row [[A]] [(to-path join "row/" col)]]
** Script error: cannot access end! in path row/1
** Where: foreach do
** Near: foreach row [[A]] [row/1]
>> z
== [foreach row [[A]] [row/1]]
>> type? first p: [row/1]                                
== path!
>> do z: compose/deep [foreach row [[A]] [(pick p col)]]
== A
>> z
== [foreach row [[A]] [row/1]]
How to get first example working? ... and then for set-path! (i.e. row/1:)
DocKimbel
TO-PATH on a string! value is not doing what you expect:
>> length? to-path "a/b"
== 1
Just replace it with LOAD and it will work fine.
And alternative way to achieve it without using strings: (append to-path 'row col)
Ashley
Wow, the append approach is pretty neat (works with to-set-path as well). Thanks.

GrahamC
For those who don't follow the progress of Ren-c, there have been some changes.  We are currently working on reaching r2 parity.  See https://trello.com/c/5K0ZKkrg/92-bringing-ren-c-to-parity-with-rebol2
I knocked off prot-smtp, prot-send and prot-pop3 recently based on the work I did many years ago.  But also did a prot-synctcp https://github.com/gchiu/Rebol3/blob/master/protocols/prot-synctcp.reb
this sort of allows you to do synchronous tcp like rebol2
And Brian is close to porting Christian Ensel's ODBC extension to ren-c
which should also work with UnixODBC
GrahamC
And current downloads are here http://metaeducation.s3.amazonaws.com/index.html ( windows, linux, OSX, and Android )
the files are much larger than the r3a builds because they include debugging, the FFI etc.

Last message posted 164 weeks ago.