From 6c304e04c18c720e4f29bb1d9e8b22d67c6a1b55 Mon Sep 17 00:00:00 2001 From: Julien Delplanque Date: Tue, 19 Mar 2019 21:31:12 +0100 Subject: [PATCH] Removed classes that were moved to Python3Generator project. Updated Baseline to point to right version of Python3Generator. --- .../BaselineOfPythonBridge.class.st | 2 +- src/PythonBridge/PBLambda.class.st | 60 ------------------- src/PythonBridge/PBLambdaTest.class.st | 31 ---------- .../PBSimpleApplicationTest.class.st | 2 +- src/PythonBridge/PBTuple.class.st | 15 ----- 5 files changed, 2 insertions(+), 108 deletions(-) delete mode 100644 src/PythonBridge/PBLambda.class.st delete mode 100644 src/PythonBridge/PBLambdaTest.class.st delete mode 100644 src/PythonBridge/PBTuple.class.st diff --git a/src/BaselineOfPythonBridge/BaselineOfPythonBridge.class.st b/src/BaselineOfPythonBridge/BaselineOfPythonBridge.class.st index 817da8e..64368ff 100644 --- a/src/BaselineOfPythonBridge/BaselineOfPythonBridge.class.st +++ b/src/BaselineOfPythonBridge/BaselineOfPythonBridge.class.st @@ -15,7 +15,7 @@ BaselineOfPythonBridge >> baseline: spec [ with: [ spec repository: 'github://pharo-contributions/OSSubprocess:v1.0.0/repository' ]. spec baseline: 'Python3Generator' - with: [ spec repository: 'github://juliendelplanque/Python3Generator:76c847c60c5345c90a0bb7d01d7dee30e8223211/repository' ]. + with: [ spec repository: 'github://juliendelplanque/Python3Generator:v1.2.0/repository' ]. spec baseline: 'NeoJSON' with: [ spec diff --git a/src/PythonBridge/PBLambda.class.st b/src/PythonBridge/PBLambda.class.st deleted file mode 100644 index 4749024..0000000 --- a/src/PythonBridge/PBLambda.class.st +++ /dev/null @@ -1,60 +0,0 @@ -Class { - #name : #PBLambda, - #superclass : #P3GGenerable, - #traits : 'P3GCallable + P3GBinaryOperationSupport', - #classTraits : 'P3GCallable classTrait + P3GBinaryOperationSupport classTrait', - #instVars : [ - 'arguments', - 'expression' - ], - #category : #'PythonBridge-P3Generator' -} - -{ #category : #'as yet unclassified' } -PBLambda class >> argument: anIdentifier expression: aPythonExpression [ - ^ self arguments: (Array with: anIdentifier) expression: aPythonExpression -] - -{ #category : #'as yet unclassified' } -PBLambda class >> arguments: listOfP3GI expression: aPythonExpression [ - ^ self new - arguments: listOfP3GI; - expression: aPythonExpression; - yourself -] - -{ #category : #'as yet unclassified' } -PBLambda class >> expression: aPythonExpression [ - ^ self arguments: #() expression: aPythonExpression -] - -{ #category : #accessing } -PBLambda >> arguments [ - ^ arguments -] - -{ #category : #accessing } -PBLambda >> arguments: anObject [ - arguments := anObject -] - -{ #category : #accessing } -PBLambda >> expression [ - ^ expression -] - -{ #category : #accessing } -PBLambda >> expression: anObject [ - expression := anObject -] - -{ #category : #accessing } -PBLambda >> writePython3On: aStream [ - aStream << '(lambda '. - arguments - do: [ :arg | arg writePython3On: aStream ] - separatedBy: [ aStream << ', ' ]. - aStream << ': '. - expression writePython3On: aStream. - aStream << ')'. -] diff --git a/src/PythonBridge/PBLambdaTest.class.st b/src/PythonBridge/PBLambdaTest.class.st deleted file mode 100644 index d105abc..0000000 --- a/src/PythonBridge/PBLambdaTest.class.st +++ /dev/null @@ -1,31 +0,0 @@ -Class { - #name : #PBLambdaTest, - #superclass : #TestCase, - #category : #'PythonBridge-P3Generator' -} - -{ #category : #tests } -PBLambdaTest >> assertCode: expr equals: targetStr [ - | string | - string := String streamContents: [ :s | expr writePython3On: s ]. - self assert: string equals: targetStr -] - -{ #category : #tests } -PBLambdaTest >> testMultipleArguments [ - | lambda | - lambda := PBLambda - arguments: (Array with: #a asP3GI with: #b asP3GI with: #c asP3GI) - expression: #a asP3GI + (#b asP3GI callWith: (Array with: #c asP3GI)). - self assertCode: lambda equals: '(lambda a, b, c: a+b(c))' -] - -{ #category : #tests } -PBLambdaTest >> testReturn1 [ - self assertCode: (PBLambda expression: 1) equals: '(lambda : 1)' -] - -{ #category : #tests } -PBLambdaTest >> testSingleArgument [ - self assertCode: (PBLambda argument: #a asP3GI expression: #a asP3GI + 1) equals: '(lambda a: a+1)' -] diff --git a/src/PythonBridge/PBSimpleApplicationTest.class.st b/src/PythonBridge/PBSimpleApplicationTest.class.st index 19976ef..14a0b36 100644 --- a/src/PythonBridge/PBSimpleApplicationTest.class.st +++ b/src/PythonBridge/PBSimpleApplicationTest.class.st @@ -25,7 +25,7 @@ PBSimpleApplicationTest >> testDoubleRetrieveValue [ { #category : #tests } PBSimpleApplicationTest >> testSimpleLambda [ - self cf << ((PBLambda + self cf << ((P3GLambda argument: #a asP3GI expression: #a asP3GI + 1) callWith: #( 2 )). self assert: self cf send waitForValue equals: 3 diff --git a/src/PythonBridge/PBTuple.class.st b/src/PythonBridge/PBTuple.class.st deleted file mode 100644 index 47811c3..0000000 --- a/src/PythonBridge/PBTuple.class.st +++ /dev/null @@ -1,15 +0,0 @@ -Class { - #name : #PBTuple, - #superclass : #OrderedCollection, - #category : #'PythonBridge-P3Generator' -} - -{ #category : #writing } -PBTuple >> writePython3On: aStream [ - aStream << '('. - self - do: [ :elem | - elem writePython3On: aStream. - aStream << ',' ]. - aStream << ')'. -]