Displaying 20 results from an estimated 25 matches for "callcc".
2008 Mar 30
2
callCC in 2.7.0
Would anyone like to explain if callCC in R 2.7.0 gives
anything that on.exit does not already provide?
It seems that the exit condition once defined cannot
be added to overridden whereas with on.exit multiple
on.exit's add additional on.exits rather than being ignored.
Is this important?
2018 Feb 27
2
Parallel assignments and goto
...return(acc)
? ? ? ? else {
? ? ? ? ? ? .tailr_n <- n - 1
? ? ? ? ? ? .tailr_acc <- acc * n
? ? ? ? ? ? n <- .tailr_n
? ? ? ? ? ? acc <- .tailr_acc
? ? ? ? ? ? next
? ? ? ? }
? ? }
}
factorial_tr_automatic_1 <- function(n, acc = 1) {
? ? .tailr_n <- n
? ? .tailr_acc <- acc
? ? callCC(function(escape) {
? ? ? ? repeat {
? ? ? ? ? ? n <- .tailr_n
? ? ? ? ? ? acc <- .tailr_acc
? ? ? ? ? ? if (n <= 1) {
? ? ? ? ? ? ? ? escape(acc)
? ? ? ? ? ? } else {
? ? ? ? ? ? ? ? .tailr_n <<- n - 1
? ? ? ? ? ? ? ? .tailr_acc <<- n * acc
? ? ? ? ? ? }
? ? ? ? }
? ? })
}
fac...
2018 Feb 26
0
Parallel assignments and goto
Following up on this attempt of implementing the tail-recursion optimisation ? now that I?ve finally had the chance to look at it again ? I find that non-local return implemented with callCC doesn?t actually incur much overhead once I do it more sensibly. I haven?t found a good way to handle parallel assignments that isn?t vastly slower than simply introducing extra variables, so I am going with that solution. However, I have now run into another problem involving those local variables...
2018 Feb 27
0
Parallel assignments and goto
...1
> .tailr_acc <- acc * n
> n <- .tailr_n
> acc <- .tailr_acc
> next
> }
> }
> }
>
> factorial_tr_automatic_1 <- function(n, acc = 1) {
> .tailr_n <- n
> .tailr_acc <- acc
> callCC(function(escape) {
> repeat {
> n <- .tailr_n
> acc <- .tailr_acc
> if (n <= 1) {
> escape(acc)
> } else {
> .tailr_n <<- n - 1
> .tailr_acc <<- n * a...
2018 Feb 11
4
Parallel assignments and goto
...introducing extra variables? solution to parallel assignment, and I could hack my way out of using `with` or `bind` in rewriting `cases`, but restarting a `repeat` loop would really make for a nicer solution. I know that `goto` is considered harmful, but really, in this case, it is what I want.
A `callCC` version also solves the problem
factorial_tr_4 <- function(n, acc = 1) {
function_body <- function(continuation) {
if (n <= 1) {
continuation(acc)
} else {
continuation(list("continue", n = n - 1, acc = acc * n))
}
}
r...
2018 Feb 11
0
Parallel assignments and goto
...g extra variables? solution to parallel assignment, and I could hack my way out of using `with` or `bind` in rewriting `cases`, but restarting a `repeat` loop would really make for a nicer solution. I know that `goto` is considered harmful, but really, in this case, it is what I want.
>
> A `callCC` version also solves the problem
>
> factorial_tr_4 <- function(n, acc = 1) {
> function_body <- function(continuation) {
> if (n <= 1) {
> continuation(acc)
> } else {
> continuation(list("continue", n = n - 1, acc = a...
2015 Nov 03
26
[Bug 11588] New: missing option: preallocate for all files except for sparse
https://bugzilla.samba.org/show_bug.cgi?id=11588
Bug ID: 11588
Summary: missing option: preallocate for all files except for
sparse
Product: rsync
Version: 3.1.2
Hardware: x64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P5
Component: core
2008 Mar 01
5
rspec with continuations: very strange
I appear to have written code which travels backwards through time:
http://www.vimeo.com/742590
This disturbs me immensely. If anyone can explain it, that would be cool.
I think it''s an illusion brought about by how RSpec wraps the code it
executes, and by the sheer weirdness of continuations.
--
Giles Bowkett
Blog: http://gilesbowkett.blogspot.com
Portfolio:
2010 Aug 24
0
[LLVMdev] DSA Analysis
...nning into a stack overflow since it is endlessly looping in the BUDataStructure::calculateGraphs method (excerpt of the debugging output is attached).
>
This is a known bug (PR#7929 at
http://llvm.org/bugs/show_bug.cgi?id=7929). You can work around this
problem by using the -dsa-no-filter-callcc=true,
-dsa-no-filter-vararg=true, and -dsa-no-filter-intfp=true options.
Apparently Will has already fixed it, so the work-around isn't necessary.
That said, there is a bug (we believe it is in BU) that causes memory
explosion on some programs (like 176.gcc). You may run into that bug
on...
2018 Feb 14
0
Parallel assignments and goto
...es? solution to parallel assignment,
> and I could hack my way out of using `with` or `bind` in rewriting `cases`, but
> restarting a `repeat` loop would really make for a nicer solution. I know that
> `goto` is considered harmful, but really, in this case, it is what I want.
>
> A `callCC` version also solves the problem
>
> factorial_tr_4 <- function(n, acc = 1) {
> function_body <- function(continuation) {
> if (n <= 1) {
> continuation(acc)
> } else {
> continuation(list("continue", n = n - 1, ac...
2011 Apr 17
2
Tail Call Elimination?
Dear R-programmers,
I am trying to program a Newton-Raphson in R (yes, i will try GSL, not right
now), and it would be a real boon if R had tail call elimination, so that a
recursive program has a guarantee not to fail due to stack overflows, given
how slow loops in R are. I did look at the documentation, but could not find
a reason for it.
Regards,
Mohit Dayal
Researcher
Applied Statistics
2008 Nov 10
3
how to stop without error message?
Dear list
Can anyone suggest a simple way to abort execution like stop(...) does, but without issuing an "Error: ..." message?
I don't want to set 'options( show.error.messages=TRUE)' because I want normal behaviour to resume after this particular stop.
(Please reply personally as well as to the list, as I'm not subscribed to R-help)
Thanks
Mark
--
Mark Bravington
2010 Aug 24
4
[LLVMdev] DSA Analysis
Hi,
I'm still using the release_26 version of Poolalloc/DSA with llvm 2.6 for my analyses and am currently trying to switch to llvm 2.7 for several reasons. I tried to use the trunk of the poolalloc svn repository with the llvm 2.7 release which is working fine for most of the programs I ran it on so far but for sqlite it's running into a stack overflow since it is endlessly looping in
2010 Nov 21
8
[beginner] simple keyword to exit script ?
I have tried quit(), and return() but first exits from whole graphical
interface and second is only for functions. What I need only to exit from
current script and return to the console.
--
View this message in context: http://r.789695.n4.nabble.com/beginner-simple-keyword-to-exit-script-tp3052417p3052417.html
Sent from the R help mailing list archive at Nabble.com.
2009 Feb 04
2
rendering error page for "Unauthorized" from before_filter
Hey all,
I am writing a plugin in which I want to stop the rendering of an
action with an unauthorized response if the user is not authorized to
view the resource. I am using a before filter to achieve this and
inside that before filter I do it like so:
render :text => "Unauthorized!", :status => :unauthorized, :layout
=> false
The status is properly set since I see the
2007 Feb 09
1
RFC2833 SIP trunks and DTMF
I have a telco providing DTMF inband, they say they can't provide it any
other way. This is creating headaches for me.
What is the common method for SIP DTMF? Kpml, or 2833 or inband?
My handsets don't support inband so I'm tying up some expensive
resources to convert the inband DTMF to out-of-band DTMF...
Can you recommend a vendor in US that provides SIP with DTMF in RFC
2009 May 13
0
rubytest.vim 0.9.5 released
...kfix: display test errors/warnings in vim quickfix window,
jump to the place where error raised in source file
quickly by press ''return''
+ Small fixes.
Get it here: http://www.vim.org/scripts/script.php?script_id=2612
Cheers,
Jan
--
jan=callcc{|jan|jan};jan.call(jan)
2009 Jun 15
0
Rubytest.vim 0.9.6 Released
...n contains some small
fix:
* support rspec examples looks like
example "this is an example" do
* correctly handle single/double quote escape for rspec examples and
vanilla testcases
Check it out here: http://www.vim.org/scripts/script.php?script_id=2612
Best,
Jan
--
jan=callcc{|jan|jan};jan.call(jan)
2006 Mar 08
1
Poor Man''s Continuations
Hi List,
I''m a new rubyist and railist, and my web-dev background is php, where
I used and contributed to the WACT framework.
Continuations are dead cool aren''t they. As I understand it, the
problem with having them in rails is that marshalling them isn''t
feasbile, so in a stateless environment, they can''t be easily
implemented. (Is this correct?)
My idea
2008 Dec 08
4
R and Scheme
I've read in many places that R semantics are based on Scheme semantics. As
a long-time Lisp user and implementor, I've tried to make this more precise,
and this is what I've found so far. I've excluded trivial things that
aren't basic semantic issues: support for arbitrary-precision integers;
subscripting; general style; etc. I would appreciate corrections or
additions from