www.jammni.de

Logo - Kleiner Drache
Login
Username:

Passwort:

Daten merken
Auto-Login
Registrieren
 
Online
niemand
 
Forumsuche
Suche nach:

Logo - DracheHaskell-Forum

Razor

Gepostet:
07.10.2011 17:50

:module [+/-] [*]M1 ... [*]Mn Problem. Modul lässtsich nicht laden  
Ich hab ein Modul erstellt, versuchte es im ghci zu laden
Modul:

module Geometry
( sphereVolume
, sphereArea
, cubeVolume
, cubeArea
, cuboidArea
, cuboidVolume
) where

sphereVolume :: Float -> Float
sphereVolume radius = (4.0 / 3.0) * pi * (radius ^ 3)

sphereArea :: Float -> Float
sphereArea radius = 4 * pi * (radius ^ 2)

cubeVolume :: Float -> Float
cubeVolume side = cuboidVolume side side side

cubeArea :: Float -> Float
cubeArea side = cuboidArea side side side

cuboidVolume :: Float -> Float -> Float -> Float
cuboidVolume a b c = rectangleArea a b * c

cuboidArea :: Float -> Float -> Float -> Float
cuboidArea a b c = rectangleArea a b * 2 + rectangleArea a c * 2 + rectangleArea c b * 2

rectangleArea :: Float -> Float -> Float
rectangleArea a b = a * b


Was im Terminal kam


miroslav@ubuntu:~$ ghci
GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :m Geometry.hs
syntax: :module [+/-] [*]M1 ... [*]Mn
Prelude> sphereVolume 2

<interactive>:1:0: Not in scope: `sphereVolume\'
Prelude>


Kann mir jemand bitte weiterhelfen
Zum Seitenanfang    
 
Landei

Gepostet:
08.10.2011 18:06

   
Versuche mal


:load Geometry.hs
Zum Seitenanfang    
 
Razor

Gepostet:
09.10.2011 09:25

   
ne..klapt auch nicht , weder unter ...@ubuntu noch unter ghci

miroslav@ubuntu:~$ :load Geometry.hs
Der Befehl »:load« wurde nicht gefunden, meinten Sie vielleicht:
Befehl »xload« aus dem Paket »x11-apps« (main)
Befehl »nload« aus dem Paket »nload« (universe)
Befehl »tload« aus dem Paket »procps« (main)
Befehl »pload« aus dem Paket »pload« (universe)
:load: Befehl nicht gefunden
miroslav@ubuntu:~$ ghci
GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :load Geometry.hs

<no location info>: can\\\'t find file: Geometry.hs
Failed, modules loaded: none.
Prelude>




Ich denke mal es könnte was mit der bashrc sein, ich versuchmal die zu richten, doch sehr gut kenn ich mich mit hash-codes nicht aus

P.S -- war sehr schlau meinen namen mit ... zu verbergen und ihn im Code dann zu schreiben :)
Zum Seitenanfang    
 
Landei

Gepostet:
09.10.2011 18:07

   
Funktioniert bei mir. GHCI sagt, er kann die Datei nicht finden, also wird sie schlicht nicht da sein, wo er sie erwartet. Groß/Kleinschreibung? Oder vielleicht mal den absoluten Pfad angeben?
Zum Seitenanfang    
 
Razor

Gepostet:
10.10.2011 15:46

   
Verflixtes Terminal :

gmiroslav@ubuntu:~$ ghci
GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :load /media/20FE20F8FE20C7BC/Ubuntu/Dokumente/Privat/Programieren/Learn Haskell/Meine Module/Geometry.hs
target `/media/20FE20F8FE20C7BC/Ubuntu/Dokumente/Privat/Programieren/Learn\' is not a module name or a source file
> sphereVolume 3

<interactive>:1:0: Not in scope: `sphereVolume\'
>



Es ist aber 100 pro ein Modul.
aber falls jemand , noch was kennt probiere ich es gerne aus... :)
Zum Seitenanfang    
 
Landei

Gepostet:
10.10.2011 20:38

   
Lies doch mal ganz genau: target `/media/20FE20F8FE20C7BC/Ubuntu/Dokumente/Privat/Programieren/Learn\\\' is not a module name...

Also hat GHCI Probleme mit den Leerzeichen im Pfad, was mich ehrlich gesagt nicht besonders verwundert...
Zum Seitenanfang