Date/Time: 2019-02-19 03:29:08 +0530 End time: 2019-02-19 03:29:10 +0530 OS Version: Mac OS X 10.14.3 (Build 18D109) Architecture: x86_64h Report Version: 27 Data Source: Stackshots Shared Cache: 0x1f672000 E4B3A94D-55C0-393C-A126-2603E9F8FC4E Shared Cache: 0 0822F2B8-73B6-3640-8E91-04395E27F608 Command: console-2019-2-4-67544 Path: /usr/lib/dyld Version: ??? (???) PID: 609 Event: hang Duration: 1.70s Steps: 17 (100ms sampling interval) Hardware model: MacBookPro14,3 Active cpus: 8 Time Awake Since Boot: 24000s Time Since Wake: 13000s Fan speed: 2155 rpm
What should I expect using
If I use it on an object word I get
?function?. This is not so meningful to me.
I ask it beacuse I wish to find which functions returns what: I wish to compare if the context of words inside block is the same of the result when using
extract, or contexts of words passed between funtions, or if words setted into a foreach loop maintain the context of the foreach block argument.
>> a: [context? 'b] == [context? 'b] >> o: object [b: 2] == make object! [ b: 2 ] >> bind a o == [context? 'b] >> do a == make object! [ b: 2 ]
word!. As Toomas noted, you can use
arr: [a b c] arr/3; c) or using
pick(pick [a b c] 3
). You can evenfind
it (first find [a b c] 'a`). As fair I remember, it's like any other way to extract values.
arr: [a b c] arr: bind arr context [a: 1 b: 2 c: 3]). I don't think it's necessary now.
>> arr: [a a: 'a :a] == [a a: 'a :a] >> reduce to-word probe first (bind arr context [a: 42]) a == 42 >> reduce to-word probe second (bind arr context [a: 42]) a: == 42 >> reduce to-word probe third (bind arr context [a: 42]) 'a == 42 >> reduce to-word probe fourth (bind arr context [a: 42]) :a == 42
I expected a result from context? but basically I was wrong. I supposed B has some context
y: [b c d] probe context? y/1
>> equal? system/words context? y/1 == true
Also I expected a result from:
z: make object! [b: 0 c: 1 d: 2] probe context? z/1
But I get an error
*** Script Error: cannot access 1 in path z/1 *** Where: context? *** Stack: probe >>