Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 20 2019 22:59
    @dockimbel banned @SmackMacDougal
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:19
    @PeterWAWood banned @TimeSeriesLord
  • Aug 13 2016 03:23
    @PeterWAWood banned @Vexercizer
nedzadarek
@nedzadarek
@Rebootr I don't have such problems. I assume you are on windows. Could you start the console (cmd) and run it from there? You may see some errors this way.
pimgeek
@pimgeek
@nedzadarek it's not synced with the cloud 😅 but possible, I can used thebrain cloud service to publish my local data online. But the cloud service is way too expensive. I plan to develop my personal customized publishing site, as well as a desktop client. 😊
Can I use the red language to manage a sqlite3 database? If I can do that, it will be cross-platform 😊
nedzadarek
@nedzadarek
@pimgeek I see. Well, I'll be waiting for it.
viayuve
@viayuve
how many core red uses when compiling.
Boleslav Březovský
@rebolek
Red does not compile, compiler is written in Rebol. And it's single threaded application.
viayuve
@viayuve
rebol pro sdk :(
Boleslav Březovský
@rebolek
No, you don't need SDK license for compiling.
Free version is enough.
viayuve
@viayuve
i just want fast compilation :cry:
Boleslav Březovský
@rebolek
I don't understand.
viayuve
@viayuve
my one program compilation takes about 5 to 7 min
Boleslav Březovský
@rebolek
That must be a big program.
Anyway. compiler is written in Rebol, so it's interpreted. You can't expect it to run fast. Once it gets rewritten to Red and compiler could be compiled, then it should get faster.
viayuve
@viayuve
0.9.5 right ?
Boleslav Březovský
@rebolek
I guess so.
Rebootr
@Rebootr
@hiiamboris You're right! in the McAfee log I found this: BehavesLike.Win32.Dropper.th, GenericRXGX-HD!9F7841A16EA4
Vladimir Vasilyev
@9214
@Rebootr please report it as a false positive. We fight an uphill battle with AV vendors whose recognize Red as "generic malware", McAfee included.
GaryMiller
@GaryMiller
Couldn't you compress the .exe file before distribution to prevent it from being falsely identified as Malware.
Semseddin Moldibi
@endo64

my one program compilation takes about 5 to 7 min

@viayuve You might compile your program with -r if it is not necessary compile without it, it would be faster (if you don't have R/S in your code of course)

GiuseppeChillemi
@GiuseppeChillemi
This message was deleted
Ops... wrong group
No... right one !

@9214
Well, I have tried the SET words-block values-block solution with no success.

test: function 
[
    action 
    passed-args-block [block!]
]
[

        args-def: [
        add 
        [
            the-path [string!]
            key [word!]
            value [any-type!]
        ]

        del
        [
            the-path [string!]
            key [string!]
        ]
    ]

        function-words: extract select args-def action 2

        set function-words passed-args-block         

]

test 'add ["a-path" "a-key" "a-value"]


probe the-path 
probe key 
probe value
"a-path"
"a-key"
"a-value"
>>>

Words set into function seems to exists after function exit:

Vladimir Vasilyev
@9214
test: function [
    action arguments
    /local
        path key value
][
    table: [
        add [path key value]
        del [path key]
    ]

    set select table action arguments
]
nedzadarek
@nedzadarek
@GiuseppeChillemi I haven't followed the discussion but:
that's because function only collect set words (+ some exception) and [the-path key value] are words.
ps. if you want post simple code snippets that people would run in the repl then avoid unnecessary new lines (e.g. after function, after first ]. Your code might compile but it won't run correctly in the repl.
GiuseppeChillemi
@GiuseppeChillemi
@9214 is there any solution without enumerating words in the argument block ? I would have the table block as the only source of words.
@nedzadarek what Is the REPL?
Respectech
@Respectech
@GiuseppeChillemi REPL is the Red console. It is a generic term for a console that takes commands and executes them.
nedzadarek
@nedzadarek
@GiuseppeChillemi google is your friend: read–eval–print loop (source). Just like Red's console:
1) it reads what you type
2) evaluates it to some data
3) print that data to the user
4) go to 1 till you close the console
More in-depth information in the source.
Greg T
@gltewalt
@GaryMiller Yes, compressing it with upx tends to be a workaround
@viayuve Are you using -c option to compile as you work. It’s much faster than -r (release mode).
You should only need release mode when your ready to distribute the binary. Release mode might take awhile, but it’s a one time thing
GiuseppeChillemi
@GiuseppeChillemi

@nedzadarek

ps. if you want post simple code snippets that people would run in the repl then avoid unnecessary new lines (e.g. after function, after first ]. Your code might compile but it won't run correctly in the repl.

Those "unnecessary" new lines avoid me being confused. Words are isolated and clear and there are not so many symbols that my mind have to decode.

GiuseppeChillemi
@GiuseppeChillemi
It seems there is no other way to have "local" words in a function other than the argument block (I have not found one). I have tried Bind 'word self with no success. Now I am wondering if SET could have a /current context refinement, to express the context that RED automatically adds to words. Another way would be to have a SET/BIND where you can express one in some way as argument of SET.
GiuseppeChillemi
@GiuseppeChillemi
I have tried even binding directly passing the current function name with no result:
test: function []
[
        set 'should-be-local "You should not see me"
        bind 'should-be-local 'test
]
probe should-be-local 

== "You should not see me"
>>
Boleslav Březovský
@rebolek
of course, that's the expected result
GiuseppeChillemi
@GiuseppeChillemi
@rebolek , I do not expect this but and error 'should-be-local should not be in the global context.
Toomas Vooglaid
@toomasv
@GiuseppeChillemi I don't think you should expect people to first correct your formatting and then advise you:
>> test: function []
*** Script Error: function is missing its body argument
*** Where: function
*** Stack:
Christian Ensel
@gurzgri
@GiuseppeChillemi , function is auto-localising only set-words and using set with a lit-word explicitly bypasses that mechanism, adding should-be-local to the global context. Even if should-be-localwould've been declared in the function's context, bind 'should-be-local 'test would rebind it to the context thetest word is bound to. With the context of the testword being the global context rather than the function's context (as you seem to assume).
The main question probably is why you would need a way to have local words in a function by other means than declaring them in the argument block at all.
GiuseppeChillemi
@GiuseppeChillemi
@toomasv Tooms, I have never tested my own code from coping and paste from gitter. Thanks to your example I have now realized that writing on the REPL console causes this problem. I thought @nedzadarek complain was about my "uncommon" formatting and not about unusability.
GiuseppeChillemi
@GiuseppeChillemi

@gurzgri Having a lot of functions operating on the the same kind of dataset, usually you have identical or simular arguments block.

I am experimenting a "simpler" approach which let me express in a way like:

db 'add-table [arguments]
db 'delete-table [arguments]
db 'add-row [arguments]

This because, as I have written: [arguments] is the same for 2 or more functions. Selecting them from a table let me:

1) Change the argument interface once and for all
2) Save a lot of typing
About this point I have still not show the block of code which maps an arguments to multiple methods.

mapping: [
   arguments-block-name-a [method1 method2 method3]
   arguments-block-name-b [method4 method5]
]

or another one (have to choose)

mapping: [
   method1 arguments-block-name-a 
   method2 arguments-block-name-a
   method3 arguments-block-name-a
   method4 arguments-block-name-b
   method5 arguments-block-name-b
   ]

(In my mind I see also function composing built from tables of code but If I won't solve this problem I can't further experiment)

GiuseppeChillemi
@GiuseppeChillemi

@gurzgri

Even if should-be-localwould've been declared in the function's context, bind 'should-be-local 'test would rebind it to the context thetest word is bound to. With the context of the testword being the global context rather than the function's context (as you seem to assume).

If I had a way to express bind this word to test function inner context and not to the outher (global) one. But SELFseems it doesn't exists and this is now blocking.

Christian Ensel
@gurzgri
@GiuseppeChillemi There may be other ways, e.g. something like
spec: [add-table delete-table [db table] add-row [db table row]] ;-- function specs 
code: [add-table [a: 1] delete-table [b: 2] add-row [c: 3]]      ;-- function bodies

db: object collect [foreach name spec [all [
    word? name
    keep reduce [to set-word! name 'function first find find spec name block! select code name]
]]]

? db
GiuseppeChillemi
@GiuseppeChillemi
@gurzgri Yes, it is another way.
But a question remains: why SELF isn't available for functions ?
Is it planned ?
Christian Ensel
@gurzgri
@GiuseppeChillemi , Sorry, I can't make any statements on Red features planned/not planned. I know of no use cases which would require it.
GiuseppeChillemi
@GiuseppeChillemi
@gurzgri extending the words of a function and binding them to the function inner context actually seems an use case.
Christian Ensel
@gurzgri
@GiuseppeChillemi With extend on objects being reserved for future use (or not yet implemented) it seems having selfin functions wouldn't gain you anything for now (I may be missing something here). Why not just have a function local word set to a map! and extend that if you think that's the way to go?
GiuseppeChillemi
@GiuseppeChillemi
@gurzgri Christian, I feel that something is missing not having the ability to access SELF for functions and if you want dynamically add some words from the inner of it, you simply can't do it. But maybe I am still to "young" to express a more argumented opinion.