AltME: Rebol School

Messages

GiuseppeC
Now seems to be solved.
GiuseppeC
Following your code
codice-temp: "C001"
do reduce [to-set-word codice-temp copy []]
how do I check dynamically if the series C001 has been created ?
I have tried this
> type? get first [codice-temp]
== string!
But as you see it does not work
sqlab
type?  get to-word codice-temp
sqlab
better to use
do reduce [to-set-word codice-temp 'copy []] or you will
always produce two copies
sorry I just have an non ergonomic keyboard
so
do reduce [to-set-word codice-temp 'copy []]
type?  get to-word codice-temp
GiuseppeC
Thanks, I am exploring dynamic table view creations with my small REBOL knowledge

sqlab
a shorter solution is
set to-word codice-temp copy []

PeterWood
Is this method of providing "private" words in objects reliable?
>> a: make object! [ b: 1 set-b: func[v] [b: v] get-b: func[][b]]
>> o: make object! [set-b: get in a 'set-b get-b: get in a 'get-b]
>> unset 'a
>> o/get-b
== 1
>> o/set-b 2
== 2
>> o/get-b
== 2
Maxim
in R3 yes.. in R2 its almost impossible since you can always get a function's body.
but I prefer this pattern:
>> o: get in context [
[     priv: 1
[     pub: context [ set-b: func[v] [priv: v] b: func[][get 'priv]]
[    ] 'pub
>> o/b
== 1
>> o/set-b 2
== 2
>> o/b
== 2
>> words-of o
== [set-b b]
actually, replace this line in the above:
pub: context [ set-b: func[v] [set 'priv v] b: func[][get 'priv]]

MGilsanz
Can anyone explain  this:
MGilsanz
>> a: 33 * 0.939393939393939
== 31.0
>> b: 31.0
== 31.0
>> to-integer a
== 30
>> to-integer b
== 31
>>
Oldes
http://floating-point-gui.de/
in R3:
>> 33 * 0.939393939393939
== 30.999999999999986
R2 is hiding these details

caelum
Is there a way to preserve the modification date of a file when copying to a new destination using 'write'? As in:
        write/binary dest/:file read/binary source/:file
This produces a modification date of now().
        print modified? 29-Jun-2014/17:02:56-7:00
In the 'Write Function Summary' I do not see any Refinement to preserve the existing modification date. Is there a way to do this?
sqlab
http://www.rebol.org/ml-display-thread.r?m=rmlFDPC
set-modes %afile [modification-date: 12-May-2004/0:00:00+10:00]
Yoi have to manually set the date  of the new file to the date of the old file
Gregg
touch: func [
    {Set the modification timestamp of the file.}
    files [file! block!] "The file, or files, you want to stamp"
    /with "Use a specified time rather than the current time."
        time [date! file!] "The date and time to stamp them with"
    /local read-only?
][
    if not with [time: now]
    if file? time [time: modified? time]
    ; Do we want to do this?
    if 0:00 = time/zone [time/zone: now/zone]
    ; We have to turn off the read-only attribute if it's on.
    foreach item compose [(files)] [
        read-only?: not get-modes item 'owner-write
        ;print ['touching item 'with time]
        set-modes to-file item [owner-write: true modification-date: time]
        if read-only? [set-modes item [owner-write: false]]
    ]
    ; Should we return the time, even though it may not match the actual
    ; stamp on the files due to OS differences?
    ;time
]

Last message posted 184 weeks ago.