similar to: R and Scheme

Displaying 20 results from an estimated 4000 matches similar to: "R and Scheme"

2009 Mar 23
2
dput(as.list(function...)...) bug
Tested in R 2.8.1 Windows > ff <- formals(function(x)1) > ff1 <- as.list(function(x)1)[1] # ff1 acts the same as ff in the examples below, but is a list rather than a pairlist > dput( ff , control=c("warnIncomplete")) list(x = ) This string is not parsable, but dput does not give a warning as specified. > dput( ff ,
2020 Mar 17
3
new bquote feature splice does not address a common LISP @ use case?
Dear R-devel, There is a new feature in R-devel, which explicitly refers to LISP @ operator for splicing. > The backquote function bquote() has a new argument splice to enable splicing a computed list of values into an expression, like ,@ in LISP's backquote. Although the most upvoted SO question asking for exactly LISP's @ functionality in R doesn't seems to be addressed by this
2009 Feb 10
1
Variable/function namespaces WAS: Bug in subsetting data frame (PR#13515)
On Tue, Feb 10, 2009 at 10:11 AM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote: > Stavros Macrakis wrote: >> On Tue, Feb 10, 2009 at 8:31 AM, Duncan Murdoch <murdoch at stats.uwo.ca>wrote: >>> The evaluator recognizes the context of usage and will get the >>> function for a function call.... >> Can you point me to chapter and verse in the language
2008 Feb 05
6
[LLVMdev] 2.2 garbage collector questions
Scott Michel <scottm <at> rushg.aero.org> writes: > Out of curiousity, for which CL implementation is this targeted? sbcl? > Or something you're rolling? I wanted to roll out my own lisp, and maybe use some library code from existing lisps (think of loop or format). Adding an LLVM backend to an existing lisp implementation is a nice idea, but currently not planned. >
2009 Apr 13
2
Using trace
I would like to trace functions, displaying their arguments and return value, but I haven't been able to figure out how to do this with the 'trace' function. After some thrashing, I got as far as this: fact <- function(x) if(x<1) 1 else x*fact(x-1) tracefnc <- function() dput(as.list(parent.frame()), # parent.frame() holds arg list
2009 Apr 13
2
Using trace
I would like to trace functions, displaying their arguments and return value, but I haven't been able to figure out how to do this with the 'trace' function. After some thrashing, I got as far as this: fact <- function(x) if(x<1) 1 else x*fact(x-1) tracefnc <- function() dput(as.list(parent.frame()), # parent.frame() holds arg list
2007 Oct 02
2
pairlist objects
Hi, ?pairlist gives no explanation about what exactly is the difference between a pairlist and a list (except that a pairlist of length 0 is 'NULL'). So, what's a pairlist? class(.Options) [1] "pairlist" Some strange things about the "pairlist" type: > showClass("pairlist") Error in getClass(Class) : "pairlist" is not a defined class
2009 Feb 22
2
Semantics of sequences in R
Inspired by the exchange between Rolf Turner and Wacek Kusnierczyk, I thought I'd clear up for myself the exact relationship among the various sequence concepts in R, including not only generic vectors (lists) and atomic vectors, but also pairlists, factor sequences, date/time sequences, and difftime sequences. I tabulated type of sequence vs. property to see if I could make sense of all
2009 Feb 22
2
Semantics of sequences in R
Inspired by the exchange between Rolf Turner and Wacek Kusnierczyk, I thought I'd clear up for myself the exact relationship among the various sequence concepts in R, including not only generic vectors (lists) and atomic vectors, but also pairlists, factor sequences, date/time sequences, and difftime sequences. I tabulated type of sequence vs. property to see if I could make sense of all
2009 Jul 29
3
Object equality for S4 objects
To test two environments for object equality (Lisp EQ), I can use 'identity': > e1 <- environment(local(function()x)) > e2 <- environment(local(function()x)) > identical(e1,e2) # compares object identity [1] FALSE > identical(as.list(e1),as.list(e2)) # compares values as name->value mapping [1] TRUE # (is there a
2020 Mar 17
0
new bquote feature splice does not address a common LISP @ use case?
Hi Jan, In the lisp code you provide the operators are parsed as simple symbols in a pairlist. In the R snippet, they are parsed as left-associative binary operators of equal precedence. If you unquote a call in the right-hand side, you're artificially bypassing the left-associativity of these operators. To achieve what you're looking for in a general way, you'll need a more precise
2005 Mar 16
1
working with pairlists imported from HDF5, converting to data frames?
I've used the HDF5 library to bring some data into R. THe verbose output looks like this: > hdf5load("hdfGraphWed_Mar_16_13_33_37_2005.hdf",load=T,verbosity=1,tidy=T) Processing object: cprSeats ...... which is a Group Processing object: Seats 0 ...... its a dataset......Finished dataset Processing object: Seats 1 ...... its a dataset......Finished dataset Processing object:
2003 Feb 14
1
pairlists (was: data manipulation function descriptions)
> -----Original Message----- > From: Luke Tierney [mailto:luke at stat.uiowa.edu] > R does not provide a pairlist data structure. This creates a dilemma > when translating some list-based xlispstat code, or, more > importantly, when implementing an algorithm for which parilists are > the natural data structure to use. > ... > Pairlists were and still are used internally
2008 Feb 05
0
[LLVMdev] 2.2 garbage collector questions
thomas weidner wrote: > Hello, > > i want to implement a common lisp subset using llvm for fun. Out of curiousity, for which CL implementation is this targeted? sbcl? Or something you're rolling? The reason why I ask is that I expressed an outrageous opinion at Supercomputing back in November, to wit, that CL is probably the best language suited for today's multicore
2006 Mar 01
4
linear lists, creation, insertion, deletion, traversal *someone?*
Hi, In a second try I will ask this list to give me some useful pointers. Linear lists, as described e.g. by N.Wirth in "Algorithms and Data Structures", seem not to be implemented in S/R, although in lisp we have cons, car, cdr. Nevertheless I want to implement an algorithm using such linear lists, porting a trusted program to R (S). I need: (from Modula/Oberon) pSC* = POINTER TO
2008 Mar 29
3
[LLVMdev] GSoC Proposal: Language bindings via. SWIG
To anyone on #llvm I'm sure I'm starting to sound like a broken record, but I'd just like to point out that for python bindings at least, you can quite easily manipulate the LLVM infrastructure via ctypes as a shared object / dll -- no C required! Those of us interested in talking to LLVM from Lisps, either Common Lisp (via CFFI) or a scheme like PLT/Mzscheme, can also use the shared
2023 Jan 12
4
return value of {....}
Hello Akshay, R is quite inspired by LISP, where this is a common thing. It is not in fact that {...} returned something, rather any expression evalulates to some value, and for a compound statement that is the last evaluated expression. {...} might be seen as similar to LISPs (begin ...). Now this is a very different thing compared to {...} in something like C, even if it looks or behaves
2023 Jan 15
3
return value of {....}
I wonder if the real confusino is not R's scope rules? (begin .) is not Lisp, it's Scheme (a major Lisp dialect), and in Scheme, (begin (define x ...) (define y ...) ...) declares variables x and y that are local to the (begin ...) form, just like Algol 68. That's weirdness 1. Javascript had a similar weirdness, when the ECMAscript process eventually addressed. But the real
2008 Feb 04
3
[LLVMdev] 2.2 garbage collector questions
Hello, i want to implement a common lisp subset using llvm for fun. This requires the use of a garbage collector. I read the docs, but many things are still unclear to me. 1. how are collectors supposed to find all living objects? there is llvm.gcroot for marking objects on the stack,but how do collectors crawl heap objects? I did not see a way to provide custom mark functions. Are
2014 May 27
1
Pretty-printer for R data
Is there a pretty-printer for R data (and code for that matter), similar to Lisp's prettyprint/grind? I've looked in CRAN, and couldn't find anything. For example, I'd like to have: prettyprint(list(a=1:20*2, b=list(data.frame(q = c(2,1,3), r = c(3,1,2), s = c(1,3,2)), as.POSIXct("2014-02-03"))) * =>* list(a = c(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22,