Dudas sobre closures

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Dudas sobre closures

Edgar De Cleene
Al importar a Pharo, obtuve el siguiente error

resolveLink: aString
    "Resolve the link. Text before an optional '|' is used as the visible
string.
    If it is an image url which is then embedded the text before '|' is
    resolved to a link for the image."

    |  parts uurl rooted u string |
    parts := aString findTokens: '|'.
    parts size = 1
        ifTrue:[u := string := aString]
        ifFalse: [u := parts at: 2. string := parts at: 1].
   
self extractCodeFrom: u block: [:url :class |
        Cannot store into ->url := model urlForLink: url. ³Fijarse el error
que aparece²

        uurl := url asUppercase.
        rooted := self isStringRooted: uurl.
        url := rooted ifFalse: [base, '/', url] ifTrue: [url].
        (rooted not and: [self isStringFlash: uurl])
            ifTrue: [(parts size = 1)
                        ifFalse:[^self localFlashURL: url string: string]
                        ifTrue: [^self localFlashURL: url string: nil]].
        (self isStringAnImage: uurl) ifTrue: ["Looks like an image URL"
            (parts size = 1)
                ifFalse:[^self imageURL: url string: (self urlForString:
string) class: class]
                ifTrue: [^self imageURL: url string: nil class: class]]
        ifFalse: [^self url: url string: string]]

La pregunta es como reemplazar correctamente ese código

Edgar