This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.scalatest._ | |
import x._ | |
import language.experimental.macros | |
class TieSpec extends FlatSpec { | |
"X" should "substitute macro argument" in { | |
val x = X.xProvider; | |
val a = new Arg[Int] {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
j: lol where r u romeo | |
r: wana come over? | |
j: cant | |
r: y? | |
j: idk parents | |
r: lets kill ourself | |
j: lol k | |
r: swag | |
j: swag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int n = 10; | |
int s = 0; | |
for(int x = 1; x < n; ++x) { | |
s+=x; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int _ = 10; | |
int _ = 0; | |
for(int _ = 1; _ < _; ++x) { | |
_ += _; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 10 1 DO i + LOOP; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: sqrt-closer (square guess -- square guess adjustment) 2dup / over - 2 / ; | |
: sqrt ( square -- root ) 1 begin sqrt-closer dup while + repeat drop nip ; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int x = 1 | |
int d = 1 | |
while(d != 0) { | |
d = (s/x - x)/2 | |
x = x+d | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqrtd(s,x,0) -> x | |
sqrtd(s,x,d) -> sqrt(s, x+d, (s/x - x)/2 ) | |
sqrt(s) -> sqrtd(s,1,(s-1)/2) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set x 1 | |
do { | |
set d [expr ($s/$x - $x)/2] | |
while { $d != 0 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc do {body whileword condition} { | |
global errorInfor errorCode | |
if {![string equal $whileword while]} { | |
error "should be \"do body while condition\"" | |
} | |
while {1} { | |
set code [catch {uplevel 1 $body} message] | |
if { !ok( $code) } { | |
return handleBreak($code, $body, $message) | |
} |