How do I fold code for comment blocks inside method blocks?
By : user3045793
Date : March 29 2020, 07:55 AM
|
How to PARSE a sequence of items where items not in blocks are handled like single element blocks?
By : TORO
Date : March 29 2020, 07:55 AM
To fix this issue I hope the following can be the basis for your solution. The following performs exactly the same in both R2 and R3. PARSE's 'into operation is VERY different between the two so I put a simple guard [.here.: block! :.here.] which fixes different bug situations in both platforms. code :
rebol [
author: "Maxim Olivier-Adlhoch"
date: 2014-02-08
license: "public domain"
]
A: [
[{Foo}]
[http://example.com/some/stuff.html]
[separator]
]
B: {[
{Foo}
http://example.com/some/stuff.html
separator
]}
C: [
[{Foo} /some-refinement]
[http://example.com/some/stuff.html {stuff caption} 3]
[separator dashed-line]
]
D: [http://example.com/some/stuff.html [{Foo} /some-refinement] 3]
depth: ""
enter-block: func [][
prin depth
print "["
append depth "^-"
]
quit-block: func [][
remove depth
prin depth
print "]"
]
emit-value: func [value][
prin depth
probe value
]
=enter-block?=: none
=block=: [
(
=enter-block?=: [into =block=] ; we enter blocks by default
enter-block
)
some [
.here.: block! :.here. ; only enter blocks (R3/R2 compatible)
(if 1 = length? .value.: first .here. [ =enter-block?=: [skip] emit-value first .value. ])
=enter-block?=
| set .value. skip ( emit-value .value. )
]
(quit-block)
]
STRING-HANDLER: func [data][
if string? data [
data: load data
]
parse data =block=
]
STRING-HANDLER A
STRING-HANDLER B
STRING-HANDLER C
STRING-HANDLER D
ask "press enter to quit ..."
|
R: sequence of substituted expressions from sequence of values
By : user3640784
Date : March 29 2020, 07:55 AM
wish helps you I want to produce , Try bquote: code :
lapply(as.numeric(2:7), function(x) bquote(10^.(x)))
|
How are expressions allowed inside Haskell do blocks
By : Vikas Parmar
Date : March 29 2020, 07:55 AM
To fix the issue you can do I'm going to crib from my very similar answer here (though probably not a duplicate since that question doesn't explicitly deal with let). The Report gives a full translation from do syntax into kernel Haskell; the parts relevant to your question are: code :
do {e} = e
do {e;stmts} = e >> do {stmts}
do {let decls; stmts} = let decls in do {stmts}
doubleX x = do
putStrLn ("I will now double " ++ (show x))
let double = x * 2
putStrLn ("The result is " ++ (show double))
==> do {e;stmts} rule
doubleX x =
putStrLn ("I will now double " ++ (show x)) >> do
let double = x * 2
putStrLn ("The result is " ++ (show double))
==> do {let decls; stmts} rule
doubleX x =
putStrLn ("I will now double " ++ (show x)) >>
let double = x * 2 in do
putStrLn ("The result is " ++ (show double))
==> do {e} rule
doubleX x =
putStrLn ("I will now double " ++ (show x)) >>
let double = x * 2 in
putStrLn ("The result is " ++ (show double))
|
How do I fold code for comment blocks inside method blocks in the Eclipse IDE
By : user2482547
Date : March 29 2020, 07:55 AM
|