search for: defun

Displaying 20 results from an estimated 51 matches for "defun".

2005 Dec 05
1
how to save output all together
Dear R users: I have a problem about catch the value from function. I have following two functions (part): sbolus1 <- function() { ....... for( i in 1:Subject) { kel<-par1 Vd<-par2 PKindex<-sbolus1.out(PKtime,kel,Vd,defun,par1,par2,Dose,i) } savefile(PKindex) } sbolus1.out<-function(PKtime,kel,Vd,defun,par1,par2,Dose,i) { time<-PKtime$time parms<-c(kel=kel,Vd=Vd) C1.lsoda<-data.frame(lsoda(Dose/Vd,c(0,time),defun,parms)) cat("\n") sim<-matrix(c(kel,Vd,par1,par2),2,2...
2013 Oct 15
2
[LLVMdev] MCJIT and DWARF debugging info and lldb
...tions A, B, and C where A generates a backtrace (using backtrace(3) and backtrace_symbols(3)) and B calls A and C calls B. The backtrace entries at 6, 10, 14 are my functions a, b, and c. All there is is entries like: "??? <white-space> 0x00000001097ee44b 0x0 + 4454278219" > (defun a () (core::backtrace)) A > (defun b () (a)) B > (defun c () (b)) C > (c) (c) Backtrace: 0 libcore_opt.dylib 0x0000000103a61687 _ZN4core12af_backtraceEv + 55 Backtrace: 1 libcore_opt.dylib 0x0000000103a62c50 _ZN4core27ActivationFrameFunctionPtrTIvv...
2013 Oct 15
0
[LLVMdev] MCJIT and DWARF debugging info and lldb
...ctions A, B, and C where A generates a backtrace (using backtrace(3) and backtrace_symbols(3)) and B calls A and C calls B. The backtrace entries at 6, 10, 14 are my functions a, b, and c. All there is is entries like: "??? <white-space> 0x00000001097ee44b 0x0 + 4454278219" > (defun a () (core::backtrace)) A > (defun b () (a)) B > (defun c () (b)) C > (c) (c) Backtrace: 0 libcore_opt.dylib 0x0000000103a61687 _ZN4core12af_backtraceEv + 55 Backtrace: 1 libcore_opt.dylib 0x0000000103a62c50 _ZN4core27ActivationFrameFunctionPtrTIvv...
2012 Nov 26
1
Help on function please
Dear All,   I could use a bit of help here, this function is hard to figure out (for me at least) I have the following so far:   PKindex<-data.frame(Subject=c(1),time=c(1,2,3,4,6,10,12),conc=c(32,28,25,22,18,14,11)) Dose<-200 Tinf <-0.5   defun<- function(time, y, parms) {  dCpdt <- -parms["kel"] * y[1]  list(dCpdt)  } modfun <- function(time,kel, Vd) {   out <- lsoda(((Dose/Tinf)*(1/(kel*Vd)))*(1-exp(-kel*time)),c(0,time),defun,parms=c(kel=kel,Vd=Vd),rtol=1e-3,atol=1e-5)  out[-1,2]  } objfun <- function(par...
2005 May 21
2
Possible (ab)use of lexical scoping in R ?
...ate a set of (user-invisible) auxilliaries used by another set of (user-visible) "main" functions. I might also wish sometimes to create a such a set of data. (Common) Lisp and Scheme allow this easily. For example, in Common Lisp, I could use : (flet ((bar (a)(...))(gee (t u)(...))) (defun foo(x y)( ...)) (defun quux(m n ...)(...))) Now (barring syntax errors I may have slipped in the above pseudo-example (my Lisp is rusty)), foo and quux are known in the main environment, can both call bar and gee, which are not visible. Lisp also allows me to do a similar thing for "data&qu...
2007 Jan 30
1
Emacs spec parsing?
Hi, Did anyone with better emacs lisp knowledge than me already come up with a function like spec-at-point which finds the specify and context declaration for the current cursor position and returns a string which can be used to be passed to the --spec option of the spec runner? Damn that would be useful ... I am currently using a function that runs spec --line with the current line number, the
2015 Apr 12
2
[LLVMdev] Looking for advice on how to debug a problem with C++ style exception handling code that my compiler generates.
...is can be called with "call" > }; > > > void A() { > try { > B(); // <<--- This needs to be called with "invoke" > } catch ( MyException& e) { > /* Do something */ > }; > }; > > > In Common Lisp: > > (defun d () > (throw 'Exception nil)) > > (defun c () > (d)) ; <-- This can be called with llvm “call” but if I JIT this > function it will fail! I need to use “invoke”! > > (defun b () > (c)) ; <-- This can be called with llvm "call" > > (defu...
2015 Apr 12
2
[LLVMdev] Looking for advice on how to debug a problem with C++ style exception handling code that my compiler generates.
...15, at 12:51 AM, Christian Schafmeister <chris.schaf at verizon.net> wrote: > Logan, > > Thank you very much for the feedback and guidance. > > The passes that I use for JIT compilation are as follows - I don’t see prune-eh in there - could it still be happening? > > (defun create-function-pass-manager-for-compile (module) > (let ((fpm (llvm-sys:make-function-pass-manager module))) > (llvm-sys:function-pass-manager-add fpm (llvm-sys:create-basic-alias-analysis-pass)) ;; <<< passes start here > (llvm-sys:function-pass-manager-add fpm (llvm...
2015 Apr 12
2
[LLVMdev] Looking for advice on how to debug a problem with C++ style exception handling code that my compiler generates.
...n.net> wrote: >> >>> Logan, >>> >>> Thank you very much for the feedback and guidance. >>> >>> The passes that I use for JIT compilation are as follows - I don’t see prune-eh in there - could it still be happening? >>> >>> (defun create-function-pass-manager-for-compile (module) >>> (let ((fpm (llvm-sys:make-function-pass-manager module))) >>> (llvm-sys:function-pass-manager-add fpm (llvm-sys:create-basic-alias-analysis-pass)) ;; <<< passes start here >>> (llvm-sys:function-pa...
2009 Apr 13
2
Using trace
...uot; arguments. (More subtly, it forces the evaluation of promises even if they are otherwise unused -- but that is, I suppose, a weird and obscure case.) Surely someone has solved this already? What I'm looking for is something very simple, along the lines of old-fashioned Lisp trace: > defun fact (i) (if (< i 1) 1 (* i (fact (+ i -1))))) FACT > (trace fact) (FACT) > (fact 3) 1> (FACT 3) 2> (FACT 2) 3> (FACT 1) 4> (FACT 0) <4 (FACT 1) <3 (FACT 1) <2 (FACT 2) <1 (FACT 6) 6 Can someone help? Thanks, -s
2009 Apr 13
2
Using trace
...uot; arguments. (More subtly, it forces the evaluation of promises even if they are otherwise unused -- but that is, I suppose, a weird and obscure case.) Surely someone has solved this already? What I'm looking for is something very simple, along the lines of old-fashioned Lisp trace: > defun fact (i) (if (< i 1) 1 (* i (fact (+ i -1))))) FACT > (trace fact) (FACT) > (fact 3) 1> (FACT 3) 2> (FACT 2) 3> (FACT 1) 4> (FACT 0) <4 (FACT 1) <3 (FACT 1) <2 (FACT 2) <1 (FACT 6) 6 Can someone help? Thanks, -s
2015 Apr 12
2
[LLVMdev] Looking for advice on how to debug a problem with C++ style exception handling code that my compiler generates.
...gt;>>> Logan, >>>> >>>> Thank you very much for the feedback and guidance. >>>> >>>> The passes that I use for JIT compilation are as follows - I don’t see prune-eh in there - could it still be happening? >>>> >>>> (defun create-function-pass-manager-for-compile (module) >>>> (let ((fpm (llvm-sys:make-function-pass-manager module))) >>>> (llvm-sys:function-pass-manager-add fpm (llvm-sys:create-basic-alias-analysis-pass)) ;; <<< passes start here >>>> (llvm-sys...
2007 Feb 08
3
coding style
...+Coding style helpers +-------------------- + +If you are using emacs, you can automatically adjust the tab-width +setting to (say) 3 spaces for all NUT sources by putting something +like this into your .emacs: + + ;; NUT style + (defun nut-c-mode () + "C mode with adjusted defaults for use with the NUT sources." + (interactive) + (c-mode) + (c-set-style "K&R") + (setq c-basic-offset 3) + (setq tab-width 3)) + + ;; apply NUT style to all C source files in all subdirectories of nut/: + + (setq auto-mod...
2015 Apr 12
2
[LLVMdev] Looking for advice on how to debug a problem with C++ style exception handling code that my compiler generates.
Hi Christian, > I don’t see anything in the Itanium ABI that says I need to call the function that throws an exception with “invoke” to get exception handling to work! AFAICT, it is the design of LLVM IR and its implementation. To catch the exceptions thrown by the callee functions, we should use the invoke instruction along with the landingpad instruction. If you are calling a function
2002 Oct 18
4
code to turn T into TRUE
Does anyone have code that will methodically process R sourcecode, turning T's into TRUE and F's into FALSE? I got bored doing this by hand, after the first 30-odd functions-- there are hundreds left to do. I don't want to simply deparse everything, because that would destroy my beautiful formatting. The reason it's not trivial, is that comment lines, quotes, and split lines need
2004 Feb 26
2
Sweave and Xemacs on Windows2000?
...in the *.Snw buffer ?? Eryk The xemacs files in my home in .xemacs directory look like init.el (load "D:/prog/XEmacs/xemacs-packages/lisp/auctex/tex-site") (load "D:/prog/XEmacs/xemacs-packages/sweave-site.el") .emacs (either in home or in home/.xemacs/ does not matter.) (defun Rnw-mode () (require 'ess-noweb) (noweb-mode) (if (fboundp 'R-mode) (setq noweb-default-code-mode 'R-mode))) (add-to-list 'auto-mode-alist '("\\.Rnw\\'" . Rnw-mode)) (add-to-list 'auto-mode-alist '("\\.Snw\\'" . Rnw-mode)) (setq r...
2009 Aug 11
1
[PATCH libguestfs] doc: improve emacs snippets
...+ (string-match "/libguestfs\\>" (buffer-file-name)) + (not (string-equal mode-name "Change Log")) + (not (string-equal mode-name "Makefile"))) + (setq indent-tabs-mode nil)))) + ;;; When editing C sources in libguestfs, use this style. (defun libguestfs-c-mode () "C mode with adjusted defaults for use with libguestfs." (interactive) (c-set-style "K&R") - (setq indent-tabs-mode nil) ; indent using spaces, not TABs (setq c-indent-level 2) (setq c-basic-offset 2)) (add-hook 'c-mode...
2002 Jul 17
1
editing Sweave files in xemacs with ess (noweb), auctex and reftex
I am having some trouble getting reftex, in particular the bibtex related features, to work properly in xemacs when editing text in Sweave files. I have added (defun Rnw-mode () (noweb-mode) (if (fboundp 'R-mode) (setq noweb-default-code-mode 'R-mode))) (add-to-list 'auto-mode-alist '("\\.Rnw\\'" . Rnw-mode)) (add-to-list 'auto-mode-alist '("\\.Snw\\'" . Snw-mode)) in my .xemacs/init.el file, as sug...
2005 Apr 30
3
How to extract function arguments literally
...e so lazy? The following is his simple example to explain the situation. R function "lc" which passes its argument to an Xlisp function: lc=function(cmd){ cmd=as.character(substitute(cmd)) .XLisp("lcommand", cmd)} Corresponding XLisp function "lcommand": (defun lcommand (str) (eval (with-input-from-string (s str) (read s)))) If the argument cmd is a string (i.e. with quotation marks) or has no space, it works fine. > as.character(substitute(abc)) [1] "abc" But, if it has no quotation marks or contains spaces, it yileds an error. > as.c...
2003 Apr 23
1
Setting up Xemacs + Sweave
Dear list, I have tried to setup my Xemacs for use with Sweave, which I indend to learn. I have followed the instructions in the Sweave FAQ, that is to say, I put (defun Rnw-mode () (require 'ess-noweb) (noweb-mode) (if (fboundp 'R-mode) (setq noweb-default-code-mode 'R-mode))) (add-to-list 'auto-mode-alist '("\\.Rnw\\'" . Rnw-mode)) (add-to-list 'auto-mode-alist '("\\.Snw\\'" . Rnw-mode)) (setq r...