~showard314/ubuntu/karmic/r-base/remove_start_comments

« back to all changes in this revision

Viewing changes to src/library/methods/R/packageName.R

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2009-01-19 12:40:24 UTC
  • mfrom: (5.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090119124024-abxsf4e0y7713w9m
Tags: 2.8.1-2
debian/control: Add another Build-Depends: exclusion for the 
'kfreebsd-i386 kfreebsd-amd64 hurd-i386' architecture to openjdk-6-jdk.
Thanks to Petr Salinger for the heads-up.               (Closes: 512324)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        pkg <- Sys.getenv("R_PACKAGE_NAME")
26
26
    env <- as.environment(where)
27
27
    envName <- environmentName(env)
28
 
    if(!nzchar(pkg)) {
 
28
    if(nzchar(envName)) {
 
29
        if(regexpr("package:", envName, fixed = TRUE) == 1)
 
30
          pkg <- sub("package:","", envName, fixed = TRUE)
 
31
    }
 
32
    if(!nzchar(pkg)) { ## is still ""
29
33
        if(identical(env, .GlobalEnv))
30
34
            pkg <- ".GlobalEnv"
31
35
        else if(identical(env, .BaseNamespaceEnv))
76
80
packageSlot <- function(object)
77
81
    attr(object, "package")
78
82
 
79
 
"packageSlot<-" <- function(object, value) {
 
83
`packageSlot<-` <- function(object, value) {
80
84
    attr(object, "package") <- value
81
85
    object
82
86
}