Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:19
    @PeterWAWood banned @TimeSeriesLord
  • Aug 13 2016 03:23
    @PeterWAWood banned @Vexercizer
Dave Andersen
@dander
@nedzadarek get-env and set-env are native!s
Greg T
@gltewalt
@toomasv Thanks.
I wanted the any-function! words wrapped in <a href="url">word</a>. The "url" could be literal for now.
I have a few ideas.
nedzadarek
@nedzadarek
@dander nice, thank you.
lepinekong
@lepinekong_twitter
@nedzadarek the scripts are totally independant, in real world like big corps they could have been written by different persons so organization of scripts should not depend on paths, that's only possible when you have such reflective properties for files even functions and not only objects.
@nedzadarek even for my own little person case, I have dozens of scripts that have been written, I don't want to look inside each one.
@nedzadarek there's a fashionable term today which is called "agile architecture" I don't like fashion but it may convey beter what I mean : you want to be able to shuffle things around ;)
BeardPower
@BeardPower
@gltewalt Alright :-)
lepinekong
@lepinekong_twitter
@nedzadarek this is kind of biological homeostasis applied to software: be independant of variable environment as much as possible, I always do things based on universal principles: that's the only things I can remember with my low number of neurons :)
nedzadarek
@nedzadarek
@lepinekong_twitter then why don't you go "node way": every program has its own sub-directory with libraries (e.g %my-program/ - main directory, %my-program/main.red - your program, %my-program/libraries - your "scripts writen by different people/organizations", %my-program/libraries/popup & %my-program/libraries/popup/main.red - library named popup with its file main.red)?
c61292558
@c61292558
how can I make my software"Icon of software at the bottom right corner"?
I don't think Red natively supports that just yet.
Semseddin Moldibi
@endo64
There are Rebol scripts for tray icons, first one uses Win32 API so can be implemented in Red / R/S, second one uses ports, we should wait for 0.7.0 for that.
http://www.rebol.org/view-script.r?script=tray.r
http://www.rebol.org/view-script.r?script=simple-system-tray.r
"Icon of software at the bottom right corner" generally named "system tray" or "tray icon".
lepinekong
@lepinekong_twitter
@nedzadarek I'm not doing a monolith giant program like a server I'm doing small autonomous modules a bit like microservices and even when languages would allow agents.
lepinekong
@lepinekong_twitter

@nedzadarek the lack of that kind of core features or worst the change in user spec that impacts word behavior like value? https://redlang.red/value really spoilt the original elegance of the language. To make a module robust to any context usage as for encapsulation having to now write:

if error? try [__DEBUG_MODE__: get in system/words '__DEBUG_MODE__][
    __DEBUG_MODE__: false
]

instead of just:

unless value? '__DEBUG_MODE__ [__DEBUG_MODE__: false]

like you could in Rebol, is well awkward to say the least.

c61292558
@c61292558
but ....i want it on Linux(deepin os)..... @endo64 @hiiamboris
hiiamboris
@hiiamboris
is there even a system tray on linux?
c61292558
@c61292558
yes
Boleslav Březovský
@rebolek
depends on WM
amreus
@amreus
Yeah more like a dozen versions of a "tray" depending on window manager.
nedzadarek
@nedzadarek
@lepinekong_twitter node is not only about servers. You could do small independent libraries.
ps. that's why we can (and should) make some mezzanines: https://gist.github.com/nedzadarek/91014c8d2514bf77940d0ff2db82713a
c61292558
@c61292558
@hiiamboris many linux distributions have their graphical interface,like deepin and so on.
lepinekong
@lepinekong_twitter
@nedzadarek I know I use nodejs, python, powershell, c#, java, etc. as I said I don't intend to rely on red only: I only use red for meta-programming level as it still lacks core protocols and libraries for interfacing with webservices for example.
GiuseppeChillemi
@GiuseppeChillemi
I have a function which calls another function. In the second one I set some new words. I wish to have them bound the the first function once the second one ends. How should I do ?
nedzadarek
@nedzadarek

@GiuseppeChillemi how about returning block/map from second function and setting them in the first function, like this:

f1: function [] [
   a: b: none
   set [a b] f2
   print ['a a 'b b]
]

f2: func [] [
   [2 3]
]
f1
; a 2 b 3

This way you can have different second functions that are not tied to the first one.

GiuseppeChillemi
@GiuseppeChillemi
@nedzadarek I do not understad how set [a b] f2 works in conjunction with f2: func [] [ [2 3]]
nedzadarek
@nedzadarek
@GiuseppeChillemi set will just set words, either one: set 'a 42 print a ; 42 or more set [a b] [1 2] print [a b] ; 1 2; f2 just returns block of values ([2 3]). So you are doing somethign like this:
bl: f2 ; `bl` is a block [2 3]
set [a b] bl ; a is set to 2 &  b is set to 3
ps. set is more powerful but I kept it simple.
hiiamboris
@hiiamboris
@GiuseppeChillemi
>> f1: function [] [a: b: none f2 print [a b]]
>> f2: does bind [a: 2 b: 3] :f1
>> f1
2 3
nedzadarek
@nedzadarek
@hiiamboris :+1:
GiuseppeChillemi
@GiuseppeChillemi
@hiiamboris F2 does not know it is F1 the caller, so :F1 is not possible, it should be generic
Also, 'a and 'b should be passed to F2 as arguments
(a block is a good solution)
@nedzadarek Understood, thanks. I will work on your proposal to get what I need.
nedzadarek
@nedzadarek
@GiuseppeChillemi
f1: function [] [a: b: none f2 a b print ['a a 'b b]]
f2: func ['a 'b][set a 1 set b 2]
f1
; a 1 b 2
hiiamboris
@hiiamboris
or if block is what you want:
>> f1: function [] [a: b: none f2 [a b] print [a b]]
>> f2: func [ws][set ws [1 2]]
>> f1
1 2
GiuseppeChillemi
@GiuseppeChillemi
@hiiamboris I do not understand if F2 words are bound to the global context ot to F1 context
also @nedzadarek
hiiamboris
@hiiamboris
@GiuseppeChillemi literal blocks ([a b]) that appear inside a function are bound to that function, and when you pass them around they retain their bindings
hiiamboris
@hiiamboris
>> a: 3 f: function [] [a: 4 f2 b: append [a] bind [a] system/words ? b print b] f
B is a block! value.  length: 2  [a a]
1 2
@GiuseppeChillemi there's a great spoon bending exercise for you ☺ https://github.com/9214/whatnot/blob/master/red/spuny-mortals.red
OneArb
@OneArb
Is it possible to ask a R2 question here?
hiiamboris
@hiiamboris
it should be
OneArb
@OneArb
I hope so :)
Boleslav Březovský
@rebolek
And the question is...? :smile:
Semseddin Moldibi
@endo64
>> o: object [a: 1]
>> f: function [] [a: 2]
>> x: bind [a] o
>> get first x
== 1
>> x: bind [a] :f
>> context? first x
== func [/local a][a: 2]
>> get first x
*** Script Error: context for a is not available
Shouldn't context is available?
Boleslav Březovský
@rebolek
I think the error message should be different probably.
The context is available, but a has no value.