From 07fcfb463c0ea0ef40cc8886ee12c4dd20d9d759 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 30 Apr 2011 22:35:55 +0000 Subject: * boot/ast.boot (bfAppend): Write in full. * interp/ptrees.boot (pfAppend): Likewise. --- src/interp/ptrees.boot | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/interp') diff --git a/src/interp/ptrees.boot b/src/interp/ptrees.boot index cbd4ac4f..4ec6f7e5 100644 --- a/src/interp/ptrees.boot +++ b/src/interp/ptrees.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2010, Gabriel Dos Reis. +-- Copyright (C) 2007-2011, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -60,7 +60,15 @@ structure %Ast == --% SPECIAL NODES pfListOf x == pfTree('listOf,x) pfListOf? x == pfAbSynOp?(x,'listOf) -pfAppend list == apply(function append,list) +pfAppend ls == + ls isnt [l,:ls] => nil + r := copyList l + p := r + repeat + ls isnt [l,:ls] => return r + l = nil => nil + lastNode(p).rest := copyList l + p := rest p pfNothing () == pfTree('nothing, []) pfNothing? form == pfAbSynOp?(form, 'nothing) -- cgit v1.2.3