MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #7535] Should NEVER happen; please bug.report() [mkCLOSXP] #2327

Closed MichaelChirico closed 4 years ago

MichaelChirico commented 4 years ago

From: "Jeroen Van Houtte UCD" <jjvanhoutte@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> I'm probably not using the function right, but anyway, the program said: "please bug.report."

w_R.f1=function(PR,Pc) return (Pc*PR^3)

w_R.f2=function(PR,Pc) return (Pc*PR)

w_R.fc=c(w_R.f1,w_R.f2)
w_R.fc[2]

[[1]] function(PR,Pc) return (Pc*PR)


RSD(type=3,

+ gparP=gpar(col="red"), + gparD=gpar(fill=FALSE,col=FALSE), + gparL=gpar(col="red",lwd=2), + gparSL=gpar(col=grey(0.5),lwd=2), + gparS=gpar(fill=FALSE,col=FALSE), + gparSP=gpar(col=grey(0.7)), + w_R.f=w_R.fc[2] + ) Error in R2SDgraph(...) : couldn't find function "w_R.f"

as.function(w_R.fc[2])

Error in as.function.default(w_R.fc[2]) : invalid body argument for "function" Should NEVER happen; please bug.report() [mkCLOSXP]

--please do not edit the information below--

Version: platform = i386-pc-mingw32 arch = i386 os = mingw32 system = i386, mingw32 status = major = 2 minor = 0.1 year = 2004 month = 11 day = 15 language = R

Windows XP Home Edition (build 2600) Service Pack 2.0

Search Path: .GlobalEnv, package:grid, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base

Respectfully, Jeroen


METADATA

MichaelChirico commented 4 years ago

From: "McGehee, Robert" <Robert.McGehee@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> ... which is equivalent to this: as.function(list(function(x){}))

which doesn't really make sense (and is the same as part #2 of bug 7495 reported earlier anyway).

Jeroen, notice that w_R.fc[2] is a list containing a function, and not the function itself. Not sure what this construct is good for, but if you want to make lists of functions, use "[[" to index the list.

Also, I think the R patch may be as easy as adding the line

stopifnot(is(x[[1]], "language"))

to the as.function(x, ...) code

--Robert

-----Original Message----- From: jjvanhoutte@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> [mailto:jjvanhoutte@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>] Sent: Tuesday, January 18, 2005 8:25 PM To: r-devel@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> Cc: R-bugs@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> Subject: [Rd] Should NEVER happen; please bug.report() [mkCLOSXP] (PR#7535)

I'm probably not using the function right, but anyway, the program said: "please bug.report."

w_R.f1=function(PR,Pc) return (Pc*PR^3)

w_R.f2=function(PR,Pc) return (Pc*PR)

w_R.fc=c(w_R.f1,w_R.f2)
w_R.fc[2]

[[1]] function(PR,Pc) return (Pc*PR)


RSD(type=3,

+ gparP=gpar(col="red"), + gparD=gpar(fill=FALSE,col=FALSE), + gparL=gpar(col="red",lwd=2), + gparSL=gpar(col=grey(0.5),lwd=2), + gparS=gpar(fill=FALSE,col=FALSE), + gparSP=gpar(col=grey(0.7)), + w_R.f=w_R.fc[2] + ) Error in R2SDgraph(...) : couldn't find function "w_R.f"

as.function(w_R.fc[2])

Error in as.function.default(w_R.fc[2]) : invalid body argument for "function" Should NEVER happen; please bug.report() [mkCLOSXP]

--please do not edit the information below--

Version: platform = i386-pc-mingw32 arch = i386 os = mingw32 system = i386, mingw32 status = major = 2 minor = 0.1 year = 2004 month = 11 day = 15 language = R

Windows XP Home Edition (build 2600) Service Pack 2.0

Search Path: .GlobalEnv, package:grid, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base

Respectfully, Jeroen


R-devel@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> mailing list https://stat.ethz.ch/mailman/listinfo/r-devel


METADATA

MichaelChirico commented 4 years ago

NOTES: Fixed for 2.2.0 Same as 7495 and 1880


METADATA

MichaelChirico commented 4 years ago

Audit (from Jitterbug): Mon Jan 24 10:25:50 2005 ripley changed notes Thu Mar 17 22:53:26 2005 thomas changed notes Tue Apr 5 21:38:11 2005 thomas moved from incoming to Low-level Thu Jun 2 18:33:03 2005 thomas changed notes Tue Jun 14 17:50:45 2005 ripley moved from Low-level to Low-level-fixed


METADATA