Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 01 2018 17:34
    @greggirwin banned @BIjeuca_twitter
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:20
    @PeterWAWood banned @TimeSeriesLord
Gregg Irwin
@greggirwin
They can also save Team Red research time. As long as Team Red knows they exist, they can leverage them as well.
BeardPower
@BeardPower
@geekyi A very good point :)
@greggirwin Yeah, having all these resources available is really great for learning Red. Thanks to everyone for providing them :+1:
Abdullah Yiğiterol
@abdllhygt
Hİ!
How to convert integer to string?
Boleslav Březovský
@rebolek
>> form 123
== "123"
Abdullah Yiğiterol
@abdllhygt
thank you!
Boleslav Březovský
@rebolek
You're welcome! There are other ways, like to string!, but I prefer form.
dimsum
@KimRoach143_twitter
@rebolek hello I am still learning red code just wondering how can I lock the file or folder and open it only with system or administrator in read only mode
any file related documentation might help
Abdullah Yiğiterol
@abdllhygt
@rebolek this doesn't work on gui :/
Boleslav Březovský
@rebolek
@KimRoach143_twitter Hi! Red currently supports only basic file operations, full I/O will come with 0.7.0, but if it will include file locking is something I honestly can’t answer.
@abdllhygt Do you have an example of non-working code?
Abdullah Yiğiterol
@abdllhygt
'''
"Kasa " [
text form 123
]
'''
"Kasa " [
text form 123
]
dimsum
@KimRoach143_twitter
@rebolek dang it, I knew it could not find in any doc :wink:
do we have MDI (Multiple document interface)with gui?? If yes any example
Boleslav Březovský
@rebolek
@abdllhygt I see, you can’t put the code there directly, use something like
compose [text (form 123)]
Abdullah Yiğiterol
@abdllhygt
doesn't work, "Script Error: VID - invalid syntax at: [(form 100)]"
BeardPower
@BeardPower
Which version are you using? Works on 0.6.3
Abdullah Yiğiterol
@abdllhygt
yes, 0.6.3
BeardPower
@BeardPower
>> compose [text (form 123)]
== [text "123"]
dimsum
@KimRoach143_twitter
yep works for me too
Vladimir Vasilyev
@9214
@abdllhygt I bet you forgot compose
Abdullah Yiğiterol
@abdllhygt
@9214 no, i did use
Boleslav Březovský
@rebolek
This works: view compose [text (form "123")]
Vladimir Vasilyev
@9214
can you show full code snippet?
Abdullah Yiğiterol
@abdllhygt
"Kasa " [
            compose [text (form 120)]
                ; "Kasa" is tab-panel
        ]
My full code is long
error message: Script Error: VID - invalid syntax at: [compose [text (form 120)]] Where: do
* Stack: view layout layout layout cause-error
Vladimir Vasilyev
@9214
@abdllhygt
view compose/deep [text-list data [(form 1) (form 2) (form 3)]]
Abdullah Yiğiterol
@abdllhygt
yes :D
thank you @9214 haha
Abdullah Yiğiterol
@abdllhygt
i develop a commercial app with red
dimsum
@KimRoach143_twitter
@abdllhygt can you please share last code because it still gives me same error
Abdullah Yiğiterol
@abdllhygt
@KimRoach143_twitter i add near view "compose/deep"
view compose/deep [
;your code
]
dimsum
@KimRoach143_twitter
thanks @abdllhygt
Abdullah Yiğiterol
@abdllhygt
you're welcome
GiuseppeChillemi
@GiuseppeChillemi
Hi, I am still having problems understanding why a: "" or a: [] does not reset the content of A
From you comments at the end of april I have realized the "code is data" concept.
In this example:
red>> do code
== func [input /local s][s: "hello world" append s input]
red>> test "x"
== "hello worldx"
red>> body-of :test
== [s: "hello worldx" append s input]
I have realized that you are directly modifing the data/code structure.
But why a: "" or a: [] lead to nothing ? Aren't we linking a: to an empty block or are "" and [] "non existant", so it is like doing nothing ?
Vladimir Vasilyev
@9214
@GiuseppeChillemi for "how" - use copy or copy/deep, for "why" - series! values are passed as pointers to some memory location, then you say something like word: [], it means "allocate some space for series, initiate it with some content (no content in this case) and make word point to that storage space" . So, in fact,word from that moment is always bound to static memory address, while content of that address could be changed and extended freely.
GiuseppeChillemi
@GiuseppeChillemi
but if you a: "abcdef" and later a: "" why it is still "abcdef" ? shouldn't "a:" get linked to another memory region ?
Vladimir Vasilyev
@9214
@GiuseppeChillemi ?
>> a: [1 2 3]
== [1 2 3]
>> a: ""
== ""
>> a
== ""
GiuseppeChillemi
@GiuseppeChillemi

rebol []

print-it: func [/local str] [
str: ""
insert str "ha"
print str
str: ""
]

try print-it many times
Vladimir Vasilyev
@9214
Body of print-it is data, just like everything else in Red. This data is represented by block of 9 elements, and while 2nd and 9th element looks identical, they're not the same thing.
Vladimir Vasilyev
@9214
perhaps my answer with pointers and stuff was misleading :confused:
Vladimir Vasilyev
@9214
>> foo: func [x][s: [no spoon] probe append s x poke body-of :foo 2 [no spoon]]
== func [x][s: [no spoon] probe append s x poke body-of :foo 2 [no spoon]]
>> foo 'whatsoever
[no spoon whatsoever]
== [no spoon]
>> body-of :foo
== [s: [no spoon] probe append s x poke body-of :foo 2 [no spoon]]
I wonder if self could be supported in specs?
Vladimir Vasilyev
@9214
>> foo: func [x][s: "before" probe append s x s: "after" probe s]
== func [x][s: "before" probe append s x s: "after" probe s]
>> foo "!!!"
"before!!!"
"after"
== "after"
>> body-of :foo
== [s: "before!!!" probe append s x s: "after" probe s]
Step by step:
  • s: means next time when you see s, evaluate it to the result of an expression that follows me, whatever it might be;
  • "before" is just a string to which s word is bound now, as implied by s: syntax;
  • append is word that is bounded to a function, that function receives two arguments that follow append word;
  • the first argument, s, evaluates to the thing that follows s:, namely "before" string, or, more specifically second element of foo's body;
  • the second argument, x, evaluates to whatever we've passed to foo;
  • now, we have second element of foo's body and some value; what append does is just this: append some value to second element of foo's body;
  • next s:, just like the first one, simply states next time when you see s, evaluate it to the result of an expression that follows me, whatever it might be;
  • and "after" is what follows s:, it's the 8th element of foo's body, all subsequent s words will be evaluated to it;
  • probe is a word that is bounded to function that blah-blah-blah;
  • finally, s is evaluated to the 8th element of foo's body, and it is what it is, just "after".