๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bln.comp.lang.opal
Article #183

Re: Currying

#183
From: Rocco Rutte
Date: Sat, 27 Nov 2004 17:11
41 lines
2702 bytes
* Alexander Winter wrote:

> Eine Angabe von
> SIGNATURE QSort[alpha, <: alpha ** alpha -> alpha]

> Erwartet an dieser Stelle explizit, dass Du eine Funktion zum
> Vergleich angibst. OPAL merkt also nicht automatisch, dass Du den
> gerade importierten Vergleich auf Nat-Zahlen haben moechtest.  Was
> funktionieren sollte, ist

> IMPORT Nat ONLY nat <
> IMPORT QSort[nat,<]

> weil OPAL ueber Funktionsinferenz automatisch errechnen kann, dass nur
> die Vergleichsfunktion aus Nat gemeint sein kann. 

Das tut auch nicht. Probleme macht die SIGNATURE-Anweisung. Das war aber
Hilfe genug, um folgendes zu machen:

SIGNATURE QSort [data,<,=,>]

SORT data

FUN < : data ** data -> bool
...

und dann beim Testen:

IMPORT QSort[nat,<,=,>]

> Besser geht's eben nicht ;)

Also ich finde es "schรถn genug". Jetzt brauche ich ja nur doch ein
passendes Szenario, wo sich von der Logik her nicht mindestens eine
Vergleichsfunktion aus den anderen beiden ergibt... ;-)

Danke fรผr die Hilfe.

  bye, Rocco
-- 
:wq!
Technical Details
Message-ID: <20041127171133.GA11333@klaus.daprodeges.fqdn.th-h.de>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.arcor.de!news.arcor.de!not-for-mail
References: <20041126185354.GA3628@bolero.cs.tu-berlin.de> <co9mce$k0u$1@news.cs.tu-berlin.de>

Show Full Headers
Complete Article Headers
X-Google-Thread: 108421,40e8db7115af3dfc
X-Google-Attributes: gid108421,public
X-Google-Language: GERMAN,UTF8
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.arcor.de!news.arcor.de!not-for-mail
From: Rocco Rutte <pdmef@gmx.net>
Newsgroups: bln.comp.lang.opal
Subject: Re: Currying
Date: Sat, 27 Nov 2004 17:11:34 +0000
Organization: Berlin University of Technology
Message-ID: <20041127171133.GA11333@klaus.daprodeges.fqdn.th-h.de>
References: <20041126185354.GA3628@bolero.cs.tu-berlin.de> <co9mce$k0u$1@news.cs.tu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Cancel-Lock: sha1:yctYDrzubBRjsgKskNF0TBVb5Z4=
User-Agent: Mutt/1.5.6i tinews.pl/1.1.7
In-Reply-To: <co9mce$k0u$1@news.cs.tu-berlin.de>
X-Orig-Date: September 4105th, 1993, 16:31:07 (UTC)
X-GnuPG-Key: http://user.cs.tu-berlin.de/~pdmef/rrutte.gpg
Content-Disposition: inline
X-PGP-Key: 0xF0518D0D
X-PGP-Sig: GnuPG-v1.2.6 From,Newsgroups,Subject,Date,Message-ID,Cancel-Lock
 iQCVAwUBQai1Rt1aDWDwUY0NAQEItwP/cTSNejuPnXo72Rf1OrdGLlct8Q1/py8X
 II0QWz5EaBt73bk/fCo4nzJG9PHqq4H2v2TSpWahjJrZ3AkIxLdqbDRICg48/+S9
 8X8tHwMprhng8m270t0F78c4kIdkN+AN3aJmN0Egd7iacGS1spsy+O+OS7cNPfXc
 M6VcCaG5ZTM=
 =bdCx
Lines: 41
NNTP-Posting-Date: 27 Nov 2004 18:24:51 MET
NNTP-Posting-Host: e4a80cbc.newsread4.arcor-online.net
X-Trace: DXC=i[7[:M^Fb;lhlIa[YhA;>c:ejgIfPPlddjW\KbG]kaMhXY;eg@jLYeliIim_31[KC`eJdb@5QR;gbhCHlF_U;cDo
X-Complaints-To: abuse@arcor.de